question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory and file exceeds size issue

See original GitHub issue

Goal

To allow app to work by solving realm memory issues

Steps & Code to Reproduce

06-12 13:45:51.895 16425-16425/? D/dalvikvm: Late-enabling CheckJNI 06-12 13:45:51.895 16425-16425/? D/dalvikvm: Try to disable coredump for pid 16425 06-12 13:45:51.895 16425-16425/? D/dalvikvm: Process 16425 nice name: com.tcrsoftware.android 06-12 13:45:51.895 16425-16425/? D/dalvikvm: Extra Options: not specified 06-12 13:45:51.935 16425-16425/com.tcrsoftware.android I/MultiDex: VM with version 1.6.0 does not have multidex support 06-12 13:45:51.935 16425-16425/com.tcrsoftware.android I/MultiDex: install 06-12 13:45:51.935 16425-16425/com.tcrsoftware.android I/MultiDex: MultiDexExtractor.load(/data/app/com.tcrsoftware.android-2.apk, false) 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android I/MultiDex: loading existing secondary dex files 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android I/MultiDex: load found 1 secondary dex files 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android I/MultiDex: install done 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android D/dalvikvm: DexOpt: couldn’t find static field Landroid/os/Build;.SUPPORTED_ABIS 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android W/dalvikvm: VFY: unable to resolve static field 162 (SUPPORTED_ABIS) in Landroid/os/Build; 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android D/dalvikvm: VFY: replacing opcode 0x62 at 0x0006 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android D/dalvikvm: DexOpt: couldn’t find static field Landroid/os/Build;.SUPPORTED_ABIS 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android I/dalvikvm: DexOpt: unable to optimize static field ref 0x00a2 at 0x0b in Lcom/getkeepsafe/relinker/SystemLibraryLoader;.supportedAbis 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android D/dalvikvm: Trying to load lib /data/app-lib/com.tcrsoftware.android-2/librealm-jni.so 0x43a301e0 06-12 13:45:51.945 16425-16425/com.tcrsoftware.android D/dalvikvm: Added shared lib /data/app-lib/com.tcrsoftware.android-2/librealm-jni.so 0x43a301e0 06-12 13:45:51.995 16425-16425/com.tcrsoftware.android D/REALM: jni: ThrowingException 11, mmap() failed: Out of memory size: 1207959552 offset: 0 in io_realm_internal_SharedGroup.cpp line 113, . 06-12 13:45:51.995 16425-16425/com.tcrsoftware.android D/REALM: Exception has been throw: Unrecoverable error. mmap() failed: Out of memory size: 1207959552 offset: 0 in io_realm_internal_SharedGroup.cpp line 113 06-12 13:45:51.995 16425-16425/com.tcrsoftware.android D/AndroidRuntime: Shutting down VM 06-12 13:45:51.995 16425-16425/com.tcrsoftware.android W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x43712160) 06-12 13:45:51.995 16425-16425/com.tcrsoftware.android E/AndroidRuntime: FATAL EXCEPTION: main Process: com.tcrsoftware.android, PID: 16425 io.realm.exceptions.RealmError: Unrecoverable error. mmap() failed: Out of memory size: 1207959552 offset: 0 in io_realm_internal_SharedGroup.cpp line 113 at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(Native Method) at io.realm.internal.SharedGroup.openSharedGroupOrFail(SharedGroup.java:95) at io.realm.internal.SharedGroup.<init>(SharedGroup.java:74) at io.realm.internal.SharedGroupManager.<init>(SharedGroupManager.java:49) at io.realm.BaseRealm.<init>(BaseRealm.java:86) at io.realm.Realm.<init>(Realm.java:135) at io.realm.Realm.createAndValidate(Realm.java:233) at io.realm.Realm.createInstance(Realm.java:214) at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:126) at io.realm.Realm.getInstance(Realm.java:178) at com.tcrsoftware.android.MainApplication.onCreate(MainApplication.java:44) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4384) at android.app.ActivityThread.access$1500(ActivityThread.java:138) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:149) at android.app.ActivityThread.main(ActivityThread.java:5061) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610) at dalvik.system.NativeStart.main(Native Method) 06-12 13:46:42.055 16425-16425/? I/Process: Sending signal. PID: 16425 SIG: 9

Code Sample

MultiDex.install(this);

    RealmConfiguration config = new RealmConfiguration.Builder(mainContext).schemaVersion(0).migration(migration).build();
    Realm.setDefaultConfiguration(config);
    realm = Realm.getInstance(config);

#### Version of Realm and tooling
Realm version(s): ? version = "1.2.0"

Realm sync feature enabled: yes/no

Android Studio version: ? 2.2.3

Which Android version and device: ? Android N. Galaxy s7  and moto g5 plus

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:40 (21 by maintainers)

github_iconTop GitHub Comments

2reactions
zaki50commented, Jun 20, 2017

You should not close Realm instance in getLogs() if you will use RealmResults outside of the method.

do i need to create realm instance in onCreate if calling from activity instead of creating instances in each method when calling from activity?

yes.

1reaction
zaki50commented, Jun 20, 2017

Realm instance returned from Realm.getDefaultInstance() is reference counted in each thread. When the Realm.getDefaultInstance() iscalled, the count is incremented and close() decrements it. close() actually closes the Realm instance only when the counter reaches 0.

So, if you already called Realm.getDefaultInstance() and corresponding close() is not yet called, realm.close() in the getTimeCard() doesn’t close actually.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maximum Memory or File Size Exceeded - Microsoft Support
This message appears when the maximum memory or file size limit for a Data Model is exceeded. In the 32-bit version of Office,...
Read more >
Is Your Virtual Memory Too Low? Here's How to Fix It!
Computer memory issues can slow down your computer over time. Here's how to set the virtual memory size and boost performance.
Read more >
Fix Copy Paste Error “The File Size Exceeds the Limit Allowed ...
Fix Copy Paste Error “the File Size Exceeds the Limit Allowed and Cannot Be Saved”.DWORD Value (In Decimals): 4294967295System errors can be ...
Read more >
File Size Limit Exceeded Error Under Linux and Solution
I am getting an error “file size limit exceeded” under Linux. ... max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe...
Read more >
Memory Limit Exceeded Error - GeeksforGeeks
It means that the program is trying to allocate more memory than the memory limit for the particular problem. For Example, if the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found