Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM in LeakCanary process while processing dump #229

Closed
kylefowler opened this issue Jul 24, 2015 · 14 comments
Closed

OOM in LeakCanary process while processing dump #229

kylefowler opened this issue Jul 24, 2015 · 14 comments

Comments

@kylefowler
Copy link

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)`

@ryancford
Copy link

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)

@pyricau
Copy link
Member

pyricau commented Aug 1, 2015

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.

@ryancford
Copy link

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

@billhsu
Copy link

billhsu commented Oct 27, 2015

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

@inverce
Copy link

inverce commented Dec 21, 2015

Same for me on

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

@pyricau
Copy link
Member

pyricau commented Jan 5, 2016

Tracking ways to fix this in #223

@pyricau pyricau closed this as completed Jan 5, 2016
@jemshit
Copy link

jemshit commented Mar 15, 2016

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

@jrodbx
Copy link
Collaborator

jrodbx commented Mar 15, 2016

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

@jemshit
Copy link

jemshit commented Mar 15, 2016

@jrodbx 1.4-beta1

@jrodbx
Copy link
Collaborator

jrodbx commented Mar 15, 2016

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

@levibostian
Copy link

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.

@herriojr
Copy link

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

@pyricau
Copy link
Member

pyricau commented Mar 30, 2016

@levibostian Can you try with 1.4-beta2 ?

btw, snapshot repo:

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

@swetakadam
Copy link

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)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants