{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/5783","repository_url":"https://api.github.com/repos/realm/realm-java","labels_url":"https://api.github.com/repos/realm/realm-java/issues/5783/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/5783/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/5783/events","html_url":"https://github.com/realm/realm-java/issues/5783","id":301022553,"number":5783,"title":"Out of memory crash on app launch","user":{"login":"nkanellopoulos","id":1705451,"avatar_url":"https://avatars2.githubusercontent.com/u/1705451?v=4","gravatar_id":"","url":"https://api.github.com/users/nkanellopoulos","html_url":"https://github.com/nkanellopoulos","followers_url":"https://api.github.com/users/nkanellopoulos/followers","following_url":"https://api.github.com/users/nkanellopoulos/following{/other_user}","gists_url":"https://api.github.com/users/nkanellopoulos/gists{/gist_id}","starred_url":"https://api.github.com/users/nkanellopoulos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkanellopoulos/subscriptions","organizations_url":"https://api.github.com/users/nkanellopoulos/orgs","repos_url":"https://api.github.com/users/nkanellopoulos/repos","events_url":"https://api.github.com/users/nkanellopoulos/events{/privacy}","received_events_url":"https://api.github.com/users/nkanellopoulos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-28T13:24:59Z","updated_at":"2018-02-28T13:50:06Z","closed_at":null,"author_association":"NONE","body":"After inserting about 5 thousand objects into a realm, my app crashes upon the **next launch** while calling `Realm.getDefaultInstance()`\r\n\r\nI tried to call `compactOnLauch()` in the default configuration, as suggested in #4998, but it did not help.\r\n\r\n     // Init Realm\r\n    Realm.init(this)\r\n\r\n     val config = RealmConfiguration.Builder()\r\n                .deleteRealmIfMigrationNeeded()\r\n                .compactOnLaunch()\r\n                .build()\r\n     Realm.setDefaultConfiguration(config)\r\n\r\n\r\nThings work fine for, say, 1600 objects.\r\n\r\nHere is my stacktrace\r\n\r\n02-28 15:13:49.699 29535-29535/? E/REALM_JNI: jni: ThrowingException 5, mmap() failed: Out of memory size: 1342177280 offset: 0 in /Users/Nabil/Dev/realm/master/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101, .\r\n02-28 15:13:49.699 29535-29535/? E/REALM_JNI: Exception has been thrown: Unrecoverable error. mmap() failed: Out of memory size: 1342177280 offset: 0 in /Users/Nabil/Dev/realm/master/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101\r\n02-28 15:13:49.701 29535-29535/? E/AndroidRuntime: FATAL EXCEPTION: main\r\n                                                   Process: fieldobservations, PID: 29535\r\n                                                   io.realm.exceptions.RealmError: Unrecoverable error. mmap() failed: Out of memory size: 1342177280 offset: 0 in /Users/Nabil/Dev/realm/master/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101\r\n                                                       at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(Native Method)\r\n                                                       at io.realm.internal.OsSharedRealm.<init>(OsSharedRealm.java:184)\r\n                                                       at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:254)\r\n                                                       at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:244)\r\n                                                       at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:319)\r\n                                                       at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:282)\r\n                                                       at io.realm.Realm.getDefaultInstance(Realm.java:332)\r\n                                                       at gr.neuropublic.fieldobservations.ui.MainActivity.onCreate(MainActivity.kt:66)\r\n                                                       at android.app.Activity.performCreate(Activity.java:5990)\r\n                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)\r\n                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)\r\n                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)\r\n                                                       at android.app.ActivityThread.access$800(ActivityThread.java:151)\r\n                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)\r\n                                                       at android.os.Handler.dispatchMessage(Handler.java:102)\r\n                                                       at android.os.Looper.loop(Looper.java:135)\r\n                                                       at android.app.ActivityThread.main(ActivityThread.java:5254)\r\n                                                       at java.lang.reflect.Method.invoke(Native Method)\r\n                                                       at java.lang.reflect.Method.invoke(Method.java:372)\r\n                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)\r\n                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)\r\n\r\n#### Version of Realm and tooling\r\nRealm version(s): 4.3.2\r\n\r\nRealm sync feature enabled: no\r\n\r\nAndroid Studio version: 3.0.1\r\n\r\nWhich Android version and device: 5.1, 6, Simulator, Nexus 4\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/369244612","html_url":"https://github.com/realm/realm-java/issues/5783#issuecomment-369244612","issue_url":"https://api.github.com/repos/realm/realm-java/issues/5783","id":369244612,"user":{"login":"Zhuinden","id":11718392,"avatar_url":"https://avatars1.githubusercontent.com/u/11718392?v=4","gravatar_id":"","url":"https://api.github.com/users/Zhuinden","html_url":"https://github.com/Zhuinden","followers_url":"https://api.github.com/users/Zhuinden/followers","following_url":"https://api.github.com/users/Zhuinden/following{/other_user}","gists_url":"https://api.github.com/users/Zhuinden/gists{/gist_id}","starred_url":"https://api.github.com/users/Zhuinden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zhuinden/subscriptions","organizations_url":"https://api.github.com/users/Zhuinden/orgs","repos_url":"https://api.github.com/users/Zhuinden/repos","events_url":"https://api.github.com/users/Zhuinden/events{/privacy}","received_events_url":"https://api.github.com/users/Zhuinden/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T13:50:06Z","updated_at":"2018-02-28T13:50:06Z","author_association":"NONE","body":"Yeah, I guess it's solved."}}
{"actor":{"display_login":"Zhuinden"}}