Leakcanary: OOM in LeakCanary process while processing dump

Created on 24 Jul 2015  Â·  14Comments  Â·  Source: square/leakcanary

java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack available
* Reference Key: 87e281ee-6c4d-4c12-b040-d0c2c1e9c2e4
* Device: samsung samsung SM-G900T kltetmo
* Android Version: 5.0 API: 21 LeakCanary: 1.4-SNAPSHOT 6c0bee2
* Durations: watch=5036ms, gc=197ms, heap dump=8458ms, analysis=14404ms
* Excluded Refs:
| Field: android.app.ActivityThread$ActivityClientRecord.nextIdle
| Field: android.view.inputmethod.InputMethodManager.mNextServedView
| Field: android.view.inputmethod.InputMethodManager.mServedView
| Field: android.view.inputmethod.InputMethodManager.mServedInputConnection
| Field: android.view.inputmethod.InputMethodManager.mCurRootView
| Field: android.animation.LayoutTransition$1.val$parent
| Field: android.view.textservice.SpellCheckerSession$1.this$0
| Field: android.accounts.AccountManager$AmsTask$Response.this$1
| Field: android.media.MediaScannerConnection.mContext
| Field: android.os.UserManager.mContext
| Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
| Static field: android.media.session.MediaSessionLegacyHelper.sInstance
| Static field: android.text.TextLine.sCached
| Static field: android.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Static field: android.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Static field: android.sec.clipboard.ClipboardUIManager.sInstance
| Thread:FinalizerWatchdogDaemon (always)
| Thread:main (always)
| Thread:LeakCanary-Heap-Dump (always)
| Class:java.lang.ref.WeakReference (always)
| Class:java.lang.ref.SoftReference (always)
| Class:java.lang.ref.PhantomReference (always)
| Class:java.lang.ref.Finalizer (always)
| Class:java.lang.ref.FinalizerReference (always)`

bug

Most helpful comment

lol
screenshot_2016-03-15-20-48-30

All 14 comments

I am getting a similar error. Although the specific failure varies, the stack trace looks the same.

I/art﹕ hprof: heap dump "/storage/emulated/0/Download/leakcanary/suspected_leak_heapdump.hprof" starting...
D/LeakCanary﹕ In com.example.foo:1.0:1.
* FAILURE:
java.lang.OutOfMemoryError: Failed to allocate a 529560 byte allocation with 352424 free bytes and 344KB until OOM
at java.util.ArrayList.add(ArrayList.java:118)
at com.squareup.haha.perflib.ClassObj.addInstance(ClassObj.java:93)
at com.squareup.haha.perflib.Snapshot.resolveClasses(Snapshot.java:284)
at com.squareup.haha.perflib.HprofParser.parse(HprofParser.java:198)
at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:77)
at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:59)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
* Reference Key: f33f8458-fe78-4cfb-8773-03ef0a3d9eb9
* Device: samsung samsung SM-G900P kltespr
* Android Version: 5.0 API: 21 LeakCanary: 1.4-SNAPSHOT 6c0bee2
* Durations: watch=5006ms, gc=169ms, heap dump=6088ms, analysis=13551ms
* Excluded Refs:
| Field: android.app.ActivityThread$ActivityClientRecord.nextIdle
| Field: android.view.inputmethod.InputMethodManager.mNextServedView
| Field: android.view.inputmethod.InputMethodManager.mServedView
| Field: android.view.inputmethod.InputMethodManager.mServedInputConnection
| Field: android.view.inputmethod.InputMethodManager.mCurRootView
| Field: android.animation.LayoutTransition$1.val$parent
| Field: android.view.textservice.SpellCheckerSession$1.this$0
| Field: android.accounts.AccountManager$AmsTask$Response.this$1
| Field: android.media.MediaScannerConnection.mContext
| Field: android.os.UserManager.mContext
| Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
| Static field: android.media.session.MediaSessionLegacyHelper.sInstance
| Static field: android.text.TextLine.sCached
| Static field: android.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Static field: android.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Static field: android.sec.clipboard.ClipboardUIManager.sInstance
| Thread:FinalizerWatchdogDaemon (always)
| Thread:main (always)
| Thread:LeakCanary-Heap-Dump (always)
| Class:java.lang.ref.WeakReference (always)
| Class:java.lang.ref.SoftReference (always)
| Class:java.lang.ref.PhantomReference (always)
| Class:java.lang.ref.Finalizer (always)
| Class:java.lang.ref.FinalizerReference (always)

I should probably include the size of the heap dump file in these reports, would help pinpointing some size after which it breaks.

Also, it would help if you could upload one of the heap dumps that caused an OOM on L. I'd like to see if there are simple tricks we could do to lower memory pressure.

This happens to me fairly often so I will upload a heap dump next time I see it.

Same error for me. On Samsung S5 with Android 5.0.

Same for me on

Android Version: 5.1.1 API: 22 LeakCanary: 1.4-SNAPSHOT Samsung SM-G903F (S5 Neo)

Tracking ways to fix this in #223

lol
screenshot_2016-03-15-20-48-30

@jemshit, are you experiencing this issue with the latest 1.4-SNAPSHOT?

@jrodbx 1.4-beta1

ok, could you try with 1.4-SNAPSHOT? It was updated earlier today with this fix.

I am experiencing this issue with 1.4-beta1 as well. Very small app with 1 simple fragment. Using Nexus 5 running marshmallow simulator. I installed LeakCanary into my app since the beginning of the project and have not had a successful dump yet. This error every time.

I could try 1.4-SNAPSHOT for you @jrodbx. What is the gradle repo for the snapshot?

I added:

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-SNAPSHOT' // or 1.3.1
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-SNAPSHOT' // or 1.3.1
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-SNAPSHOT' // or 1.3.1

to my build.gradle, did a sync, and it could not find 1.4-SNAPSHOT.

I am experiencing the issue on 1.4-SNAPSHOT with the "no stack available" image posted by @jemshit

@levibostian Can you try with 1.4-beta2 ?

btw, snapshot repo:

  repositories {
    mavenCentral()
    maven {
      url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
  }

I am getting the same error on Samsung Note Android 5.0

Throwing OutOfMemoryError "Failed to allocate a 1048588 byte allocation with 8388608 free bytes and 362MB until OOM; failed due to fragmentation (required continguous free 1052672 bytes where largest contiguous free 606208 bytes)"

Was this page helpful?
0 / 5 - 0 ratings