Closed jamesbluecrow closed 5 years ago
@jrodbx so, yep, we still need to do something about this :) .
Yep, indeed we do, @pyricau . While we've reduced the memory pressure caused by enqueueing all GC roots, we're still hitting a wall during the analysis. @DaviddeMiguel could you upload your heap dump? I'm exploring some options and, the more heap dump samples for testing, the better!
Happens all the time for me since updated to 1.4-beta2. Don't have any issues with 1.3.1.
I am getting same error message.
I can't @jrodbx because leakcanary tries to attach it to gmail and it seems to be bigger than 20MB. I can tell you how to reproduce it, it is happening when I try to do login with facebook in a device that has not the facebook app installed (the memory leak seems to be related to the webview).
Here is the two traces reported with the version 1.3.1:
1:
In com.trov.maui.dev.debug:2.1.0 (local):16.
* com.facebook.FacebookActivity has leaked:
* GC ROOT static android.view.WindowManagerGlobal.sDefaultWindowManager
* references android.view.WindowManagerGlobal.mViews
* references java.util.ArrayList.array
* references array java.lang.Object[].[1]
* references com.android.internal.policy.impl.PhoneWindow$DecorView.mContext
* references android.view.ContextThemeWrapper.mBase
* leaks com.facebook.FacebookActivity instance
* Reference Key: a32c881b-319c-4dca-b463-322e566c7de4
* Device: unknown generic Google Nexus 5 - 5.1.0 - API 22 - 1080x1920 vbox86p
* Android Version: 5.1 API: 22 LeakCanary: 1.3.1
* Durations: watch=6863ms, gc=342ms, heap dump=1205ms, analysis=4611ms
* Details:
* Class android.view.WindowManagerGlobal
| static $staticOverhead = byte[] [id=0x709cea89;length=184;size=200]
| static ADD_APP_EXITING = -4
| static ADD_BAD_APP_TOKEN = -1
| static ADD_BAD_SUBWINDOW_TOKEN = -2
| static ADD_DUPLICATE_ADD = -5
| static ADD_FLAG_APP_VISIBLE =
\ 2: **
In com.trov.maui.dev.debug:2.1.0 (local):16.
* com.facebook.FacebookActivity has leaked:
* GC ROOT android.os.ResultReceiver$MyResultReceiver.this$0
* references com.android.org.chromium.content.browser.ContentViewCore$3$1.this$1 (anonymous class extends android.os.ResultReceiver)
* references com.android.org.chromium.content.browser.ContentViewCore$3.this$0
* references com.android.org.chromium.content.browser.ContentViewCore.mContainerView
* references com.facebook.internal.WebDialog$3.this$0 (anonymous class extends android.webkit.WebView)
* references com.facebook.internal.WebDialog.mOwnerActivity
* leaks com.facebook.FacebookActivity instance
* Reference Key: b0a003eb-21f7-4f2f-a18f-34c6b552b395
* Device: unknown generic Google Nexus 5 - 5.1.0 - API 22 - 1080x1920 vbox86p
* Android Version: 5.1 API: 22 LeakCanary: 1.3.1
* Durations: watch=5014ms, gc=116ms, heap dump=1398ms, analysis=3570ms
* Details:
* Instance of android.os.ResultReceiver$MyResultReceiver
| this$0 = com.android.org.chromium.content
@DaviddeMiguel. Do you fix this issue? I have the same issue and don't know how to fix it. Thanks.
In 1.5: same error:
@mmm2006 we are using LeakCanary version 1.4 and I don't see the problem, we haven't updated to 1.5 yet (but indeed Facebook is producing a memory leak)
I am facing the same issue on 1.4 also
Same here. testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
java.lang.OutOfMemoryError: Failed to allocate a 2020136 byte allocation with 1267000 free bytes and 1237KB until OOM
at java.util.ArrayList.
Occurred in 1.5 on Samsung Galaxy J7:
FAILURE in 1.5 00f37f5:java.lang.OutOfMemoryError: Failed to allocate a 350888 byte allocation with 221552 free bytes and 216KB until OOM at com.squareup.haha.trove.THashMap.rehash(THashMap.java:342) at com.squareup.haha.trove.THash.postInsertHook(THash.java:283) at com.squareup.haha.trove.THashMap.put(THashMap.java:175) at com.squareup.leakcanary.HeapAnalyzer.deduplicateGcRoots(HeapAnalyzer.java:139) at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:113) at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.os.HandlerThread.run(HandlerThread.java:61)
Reference Key: 924b0831-24e0-4c4f-9b86-a5c85cd96424
Device: samsung samsung SM-J710GN j7xeltezt
Android Version: 6.0.1 API: 23 LeakCanary: 1.5 00f37f5
Durations: watch=5339ms, gc=135ms, heap dump=3087ms, analysis=8463ms
Excluded Refs: | 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.os.UserManager.mContext | Field: android.net.ConnectivityManager.sInstance | Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always) | 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 am facing the same issue on 1.5 also and the same as the error message.
I haven't had a successful analysis on Genymotion yet, is there something I can do in the emulator settings to help? Haven't had any issues on Nexus 5X, about to roll this out to the rest of the devs and would like to at least have it working on Genymotion.
hprof: heap dump completed (39MB) in 2.911s
FAILURE in 1.5.1 1be44b3:java.lang.OutOfMemoryError: Failed to allocate a 1191492 byte allocation with 8388608 free bytes and 18MB until OOM; failed due to fragmentation (required continguous free 1191936 bytes where largest contiguous free 167936 bytes) at java.util.ArrayList.add(ArrayList.java:118) at com.squareup.haha.perflib.analysis.TopologicalSort$TopologicalSortVisitor.doVisit(TopologicalSort.java:92) at com.squareup.haha.perflib.analysis.TopologicalSort.compute(TopologicalSort.java:36) at com.squareup.haha.perflib.Snapshot.computeDominators(Snapshot.java:311) at com.squareup.leakcanary.HeapAnalyzer.findLeakTrace(HeapAnalyzer.java:188) at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:123) at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61)
Reference Key: 1a1461f2-e5aa-4404-b079-4a3951996d44
Device: Genymotion Android Nexus 5 vbox86p
Android Version: 6.0 API: 23 LeakCanary: 1.5.1 1be44b3
Durations: watch=10386ms, gc=117ms, heap dump=3058ms, analysis=4693ms
I have the same issue
FAILURE in 1.5.1 1be44b3:java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available
Reference Key: d491403b-d663-4e14-8e23-717cb46d7e6d
Device: motorola motorola MotoG3 osprey_retasia_ds_2gb
Android Version: 6.0.1 API: 23 LeakCanary: 1.5.1 1be44b3
Durations: watch=5014ms, gc=137ms, heap dump=6016ms, analysis=156146ms
Excluded Refs: | 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.os.UserManager.mContext | Field: android.net.ConnectivityManager.sInstance | Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always) | 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 tried use 1.5.1. and got OOM:
* FAILURE in 1.5.1 1be44b3:java.lang.OutOfMemoryError: Failed to allocate a 1440592 byte allocation with 632800 free bytes and 617KB until OOM
at java.util.Arrays.copyOf(Arrays.java:3231)
at java.util.Arrays.copyOf(Arrays.java:3204)
at java.util.ArrayList.grow(ArrayList.java:249)
at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:223)
at java.util.ArrayList.ensureCapacityInternal(ArrayList.java:215)
at java.util.ArrayList.add(ArrayList.java:441)
at com.squareup.haha.perflib.analysis.TopologicalSort$TopologicalSortVisitor.doVisit(TopologicalSort.java:92)
at com.squareup.haha.perflib.analysis.TopologicalSort.compute(TopologicalSort.java:36)
at com.squareup.haha.perflib.Snapshot.computeDominators(Snapshot.java:311)
at com.squareup.leakcanary.HeapAnalyzer.findLeakTrace(HeapAnalyzer.java:157)
at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:91)
at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
* Reference Key: 9aad01f6-2571-4970-aa68-439d5f99a484
* Device: Genymotion Android Custom Phone - 7.0.0 - API 24 - 768x1280 vbox86p
* Android Version: 7.0 API: 24 LeakCanary: 1.5.1 1be44b3
* Durations: watch=6595ms, gc=122ms, heap dump=6916ms, analysis=5281ms
* Excluded Refs:
| Field: android.widget.Editor$Blink.this$0
| Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
| 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)
Hi,
It seems always in 1.5.1:
* FAILURE in 1.5.1 1be44b3:java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack available
* Reference Key: 896e8324-3968-46e7-9ad9-b8dd168b4e8b
* Device: asus asus P01W WW_P01W
* Android Version: 5.0.2 API: 21 LeakCanary: 1.5.1 1be44b3
* Durations: watch=71698ms, gc=351ms, heap dump=4797ms, analysis=60220ms
* 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.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Field: android.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Field: android.accounts.AccountManager$AmsTask$Response.this$1
| Field: android.media.MediaScannerConnection.mContext
| Field: android.os.UserManager.mContext
| Field: android.appwidget.AppWidgetHost$Callbacks.this$0
| Field: android.media.AudioManager$1.this$0
| Field: android.widget.Editor$Blink.this$0
| Field: android.net.ConnectivityManager.sInstance
| Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
| Static field: android.media.session.MediaSessionLegacyHelper.sInstance
| Static field: android.text.TextLine.sCached
| 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)
A workaround or tips ?
Thanks
I was getting Memory Error on Android 5.0 Samsung Note .. so I upgraded my leakcanary from 1.5 to 1.5.1 and now I am getting
07-06 11:55:37.798 7183-7192/com.signnow.snandroid:leakcanary W/art: Suspending all threads took: 58.823ms 07-06 11:55:37.818 7183-7206/com.signnow.snandroid:leakcanary W/art: Suspending all threads took: 15.381ms 07-06 11:55:48.148 7183-7234/com.signnow.snandroid:leakcanary I/art: WaitForGcToComplete blocked for 294.334ms for cause Alloc 07-06 11:55:49.118 7183-7234/com.signnow.snandroid:leakcanary I/art: WaitForGcToComplete blocked for 234.174ms for cause Alloc 07-06 11:55:49.848 7183-7234/com.signnow.snandroid:leakcanary I/art: WaitForGcToComplete blocked for 11.033ms for cause Alloc 07-06 11:55:50.148 7183-7234/com.signnow.snandroid:leakcanary I/art: WaitForGcToComplete blocked for 264.749ms for cause Alloc 07-06 11:55:50.828 7183-7234/com.signnow.snandroid:leakcanary W/art: Suspending all threads took: 13.437ms 07-06 11:55:51.348 7183-7234/com.signnow.snandroid:leakcanary I/art: WaitForGcToComplete blocked for 17.758ms for cause Alloc 07-06 11:55:51.668 7183-7234/com.signnow.snandroid:leakcanary I/art: WaitForGcToComplete blocked for 286.948ms for cause Alloc 07-06 11:56:02.658 7183-7192/com.signnow.snandroid:leakcanary W/art: Suspending all threads took: 278.792ms 07-06 11:56:05.958 7183-7234/com.signnow.snandroid:leakcanary A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x88d30fc0 in tid 7234 (IntentService[H)
A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x88d30fc0 in tid 7234 (IntentService[H) @pyricau any input .. it crashes my app .. I am new to Android development
Reference Key: 5b66bbcb-72c8-4c32-a5ac-c8e9c1fe8c94
- FAILURE in 1.5.1 1be44b3:java.lang.OutOfMemoryError: Failed to allocate a 529560 byte allocation with 260968 free bytes and 254KB 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:113) at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58) 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)
| 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.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy | Field: android.widget.ActivityChooserModel.mActivityChoserModelPolicy | Field: android.accounts.AccountManager$AmsTask$Response.this$1 | Field: android.media.MediaScannerConnection.mContext | Field: android.os.UserManager.mContext | Field: android.appwidget.AppWidgetHost$Callbacks.this$0 | Field: android.media.AudioManager$1.this$0 | Field: android.widget.Editor$Blink.this$0 | Field: android.net.ConnectivityManager.sInstance | Field: android.sec.clipboard.ClipboardUIManager.mContext | Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always) | Static field: android.media.session.MediaSessionLegacyHelper.sInstance | Static field: android.text.TextLine.sCached | Static field: android.widget.TextView.mLastHoveredView | 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)
Samsung Galaxy J3 (2016) on Android 5.1.1 using LeakCanary 1.5.4.
In nl.company.appname.development:1.0-development:1.
* FAILURE in 1.5.4 74837f0:java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack available
* Reference Key: 6a3dfc0c-47fa-44f5-9908-7facee1617c9
* Device: samsung samsung SM-J320FN j3xnltexx
* Android Version: 5.1.1 API: 22 LeakCanary: 1.5.4 74837f0
* Durations: watch=5033ms, gc=174ms, heap dump=2704ms, analysis=38729ms
* Excluded Refs:
| 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.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Field: android.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Field: android.accounts.AccountManager$AmsTask$Response.this$1
| Field: android.media.MediaScannerConnection.mContext
| Field: android.os.UserManager.mContext
| Field: android.media.AudioManager$1.this$0
| Field: android.widget.Editor$Blink.this$0
| Field: android.net.ConnectivityManager.sInstance
| Field: com.samsung.android.content.clipboard.SemClipboardManager.mContext
| Field: com.samsung.android.emergencymode.SemEmergencyManager.mContext
| Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
| Static field: android.text.TextLine.sCached
| Static field: android.widget.TextView.mLastHoveredView
| Static field: android.app.ActivityManager.mContext
| 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)
Samsung Galaxy A3 2017 (SM-A320FL) on Android 6.0.1 using LeakCanary 1.5.4
In it.blobby.blobby:1.0.5-beta:1005.
* FAILURE in 1.5.4 74837f0:java.lang.OutOfMemoryError: Failed to allocate a 353044 byte allocation with 329784 free bytes and 322KB 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:114)
at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
* Reference Key: 646522a1-5a9f-4afb-864f-19dd26883f74
* Device: samsung samsung SM-A320FL a3y17ltexc
* Android Version: 6.0.1 API: 23 LeakCanary: 1.5.4 74837f0
* Durations: watch=75509ms, gc=132ms, heap dump=4305ms, analysis=9877ms
* Excluded Refs:
| 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.os.UserManager.mContext
| Field: android.net.ConnectivityManager.sInstance
| Field: com.samsung.android.content.clipboard.SemClipboardManager.mContext
| Field: com.samsung.android.emergencymode.SemEmergencyManager.mContext
| Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
| 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)
FAILURE in 1.5.4 74837f0:java.lang.OutOfMemoryError at com.squareup.haha.trove.TLongObjectHashMap.rehash(TLongObjectHashMap.java:226) at com.squareup.haha.trove.THash.postInsertHook(THash.java:283) at com.squareup.haha.trove.TLongObjectHashMap.put(TLongObjectHashMap.java:209) at com.squareup.haha.perflib.Heap.addInstance(Heap.java:119) at com.squareup.haha.perflib.Snapshot.addInstance(Snapshot.java:186) at com.squareup.haha.perflib.HprofParser.loadInstanceDump(HprofParser.java:563) at com.squareup.haha.perflib.HprofParser.loadHeapDump(HprofParser.java:351) at com.squareup.haha.perflib.HprofParser.parse(HprofParser.java:186) at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:114) at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.os.HandlerThread.run(HandlerThread.java:60)
Reference Key: b7d4283e-b811-4e63-bfb1-34339302385b
Device: Samsung Samsung GT-I8150 cm_ancora
Android Version: 4.1.2 API: 16 LeakCanary: 1.5.4 74837f0
Durations: watch=5022ms, gc=197ms, heap dump=953ms, analysis=4037ms
Excluded Refs: | Field: android.widget.Editor$EasyEditSpanController.this$0 | Field: android.widget.Editor$SpanController.this$0 | Field: android.os.Message.obj | Field: android.os.Message.next | Field: android.os.Message.target | 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.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy | Field: android.widget.ActivityChooserModel.mActivityChoserModelPolicy | Field: android.speech.SpeechRecognizer$InternalListener.this$0 | Field: android.accounts.AccountManager$AmsTask$Response.this$1 | Field: android.media.MediaScannerConnection.mContext | Field: android.os.UserManager.mContext | Field: android.appwidget.AppWidgetHost$Callbacks.this$0 | Field: android.media.AudioManager$1.this$0 | Field: android.widget.Editor$Blink.this$0 | Field: android.net.ConnectivityManager.sInstance | Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always) | Static field: android.text.TextLine.sCached | 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)
Same error
* FAILURE in 1.5.4 74837f0:java.lang.OutOfMemoryError: Failed to allocate a 2807208 byte allocation with 374960 free bytes and 366KB until OOM
at com.squareup.haha.trove.TLongObjectHashMap.rehash(TLongObjectHashMap.java:226)
at com.squareup.haha.trove.THash.postInsertHook(THash.java:283)
at com.squareup.haha.trove.TLongObjectHashMap.put(TLongObjectHashMap.java:209)
at com.squareup.haha.perflib.Heap.addInstance(Heap.java:119)
at com.squareup.haha.perflib.Snapshot.addInstance(Snapshot.java:186)
at com.squareup.haha.perflib.HprofParser.loadInstanceDump(HprofParser.java:563)
at com.squareup.haha.perflib.HprofParser.loadHeapDump(HprofParser.java:351)
at com.squareup.haha.perflib.HprofParser.parse(HprofParser.java:186)
at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:114)
at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58)
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: 1fab30b1-37ba-40b7-9395-9ea7d68d59ea
* Device: samsung samsung SM-N9005 hltexx
* Android Version: 5.0 API: 21 LeakCanary: 1.5.4 74837f0
* Durations: watch=5495ms, gc=184ms, heap dump=5974ms, analysis=8952ms
* Excluded Refs:
| Field: android.app.ActivityThread$ActivityClientRecord.nextIdle
| Field: android.os.Message.obj
| Field: android.os.Message.next
| Field: android.os.Message.target
| 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.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Field: android.widget.ActivityChooserModel.mActivityChoserModelPolicy
| Field: android.accounts.AccountManager$AmsTask$Response.this$1
| Field: android.media.MediaScannerConnection.mContext
| Field: android.os.UserManager.mContext
| Field: android.appwidget.AppWidgetHost$Callbacks.this$0
| Field: android.media.AudioManager$1.this$0
| Field: android.widget.Editor$Blink.this$0
| Field: android.net.ConnectivityManager.sInstance
| Field: android.sec.clipboard.ClipboardUIManager.mContext
| Field: com.samsung.android.content.clipboard.SemClipboardManager.mContext
| Field: com.samsung.android.emergencymode.SemEmergencyManager.mContext
| Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
| Static field: android.media.session.MediaSessionLegacyHelper.sInstance
| Static field: android.text.TextLine.sCached
| Static field: android.widget.TextView.mLastHoveredView
| 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)
OOM here too, though the stacktrace looks slightly different:
02-19 16:13:33.785 25783 25893 D LeakCanary: * FAILURE in 1.5.4 74837f0:java.lang.OutOfMemoryError
02-19 16:13:33.785 25783 25893 D LeakCanary: at java.util.HashMap.makeTable(HashMap.java:569)
02-19 16:13:33.785 25783 25893 D LeakCanary: at java.util.HashMap.doubleCapacity(HashMap.java:589)
02-19 16:13:33.785 25783 25893 D LeakCanary: at java.util.HashMap.put(HashMap.java:419)
02-19 16:13:33.785 25783 25893 D LeakCanary: at java.util.HashSet.add(HashSet.java:95)
02-19 16:13:33.785 25783 25893 D LeakCanary: at com.squareup.leakcanary.ShortestPathFinder.enqueue(ShortestPathFinder.java:306)
02-19 16:13:33.785 25783 25893 D LeakCanary: at com.squareup.leakcanary.ShortestPathFinder.visitClassInstance(ShortestPathFinder.java:266)
02-19 16:13:33.785 25783 25893 D LeakCanary: at com.squareup.leakcanary.ShortestPathFinder.findPath(ShortestPathFinder.java:113)
02-19 16:13:33.785 25783 25893 D LeakCanary: at com.squareup.leakcanary.HeapAnalyzer.findLeakTrace(HeapAnalyzer.java:177)
02-19 16:13:33.785 25783 25893 D LeakCanary: at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:124)
02-19 16:13:33.785 25783 25893 D LeakCanary: at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58)
02-19 16:13:33.785 25783 25893 D LeakCanary: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
02-19 16:13:33.785 25783 25893 D LeakCanary: at android.os.Handler.dispatchMessage(Handler.java:102)
02-19 16:13:33.785 25783 25893 D LeakCanary: at android.os.Looper.loop(Looper.java:146)
02-19 16:13:33.785 25783 25893 D LeakCanary: at android.os.HandlerThread.run(HandlerThread.java:61)
02-19 16:13:33.785 25783 25893 D LeakCanary:
02-19 16:13:33.785 25783 25893 D LeakCanary: * Reference Key: a75afe02-e18a-4212-956e-600314b12905
02-19 16:13:33.785 25783 25893 D LeakCanary: * Device: samsung samsung GT-N7105 t0ltexx
02-19 16:13:33.785 25783 25893 D LeakCanary: * Android Version: 4.4.2 API: 19 LeakCanary: 1.5.4 74837f0
02-19 16:13:33.785 25783 25893 D LeakCanary: * Durations: watch=155899ms, gc=172ms, heap dump=975ms, analysis=9764ms
02-19 16:13:33.785 25783 25893 D LeakCanary: * Excluded Refs:
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.app.ActivityThread$ActivityClientRecord.nextIdle
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.widget.Editor$EasyEditSpanController.this$0
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.widget.Editor$SpanController.this$0
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.os.Message.obj
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.os.Message.next
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.os.Message.target
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.view.inputmethod.InputMethodManager.mNextServedView
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.view.inputmethod.InputMethodManager.mServedView
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.view.inputmethod.InputMethodManager.mServedInputConnection
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.view.inputmethod.InputMethodManager.mCurRootView
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.animation.LayoutTransition$1.val$parent
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.view.textservice.SpellCheckerSession$1.this$0
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.widget.ActivityChooserModel.mActivityChoserModelPolicy
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.speech.SpeechRecognizer$InternalListener.this$0
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.accounts.AccountManager$AmsTask$Response.this$1
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.media.MediaScannerConnection.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.os.UserManager.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.appwidget.AppWidgetHost$Callbacks.this$0
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.media.AudioManager$1.this$0
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.widget.Editor$Blink.this$0
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.net.ConnectivityManager.sInstance
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.sec.clipboard.ClipboardUIManager.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: com.samsung.android.content.clipboard.SemClipboardManager.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: com.samsung.android.emergencymode.SemEmergencyManager.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.os.PersonaManager.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.content.res.Resources.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.view.ViewConfiguration.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
02-19 16:13:33.785 25783 25893 D LeakCanary: | Static field: android.text.TextLine.sCached
02-19 16:13:33.785 25783 25893 D LeakCanary: | Static field: com.samsung.android.smartclip.SpenGestureManager.mContext
02-19 16:13:33.785 25783 25893 D LeakCanary: | Static field: com.android.org.chromium.android_webview.AwResource.sResources
02-19 16:13:33.785 25783 25893 D LeakCanary: | Static field: android.widget.TextView.mLastHoveredView
02-19 16:13:33.785 25783 25893 D LeakCanary: | Static field: android.media.AudioManager.mContext_static
02-19 16:13:33.785 25783 25893 D LeakCanary: | Thread:FinalizerWatchdogDaemon (always)
02-19 16:13:33.785 25783 25893 D LeakCanary: | Thread:main (always)
02-19 16:13:33.785 25783 25893 D LeakCanary: | Thread:LeakCanary-Heap-Dump (always)
02-19 16:13:33.785 25783 25893 D LeakCanary: | Class:java.lang.ref.WeakReference (always)
02-19 16:13:33.785 25783 25893 D LeakCanary: | Class:java.lang.ref.SoftReference (always)
02-19 16:13:33.785 25783 25893 D LeakCanary: | Class:java.lang.ref.PhantomReference (always)
02-19 16:13:33.785 25783 25893 D LeakCanary: | Class:java.lang.ref.Finalizer (always)
02-19 16:13:33.785 25783 25893 D LeakCanary: | Class:java.lang.ref.FinalizerReference (always)
Same issue here.
* FAILURE in 1.5.4 74837f0:java.lang.OutOfMemoryError: Failed to allocate a 5614568 byte allocation with 2758160 free bytes and 2MB until OOM
at com.squareup.haha.trove.TLongHashSet.rehash(TLongHashSet.java:162)
at com.squareup.haha.trove.THash.postInsertHook(THash.java:283)
at com.squareup.haha.trove.TLongHashSet.add(TLongHashSet.java:146)
at com.squareup.haha.perflib.analysis.TopologicalSort$TopologicalSortVisitor.doVisit(TopologicalSort.java:87)
at com.squareup.haha.perflib.analysis.TopologicalSort.compute(TopologicalSort.java:36)
at com.squareup.haha.perflib.Snapshot.computeDominators(Snapshot.java:311)
at com.squareup.leakcanary.HeapAnalyzer.findLeakTrace(HeapAnalyzer.java:189)
at com.squareup.leakcanary.HeapAnalyzer.checkForLeak(HeapAnalyzer.java:124)
at com.squareup.leakcanary.internal.HeapAnalyzerService.onHandleIntent(HeapAnalyzerService.java:58)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
* Reference Key: d5e1db0d-11c6-42b3-9fe8-c9324529b7b4
* Device: samsung samsung SM-T580 gtaxlwifixx
* Android Version: 7.0 API: 24 LeakCanary: 1.5.4 74837f0
* Durations: watch=5166180ms, gc=387ms, heap dump=4928ms, analysis=42764ms
* Excluded Refs:
| Field: android.view.inputmethod.InputMethodManager.mNextServedView
| Field: android.view.inputmethod.InputMethodManager.mServedView
| Field: android.view.inputmethod.InputMethodManager.mServedInputConnection
| Field: android.view.textservice.SpellCheckerSession$1.this$0
| Field: com.samsung.android.content.clipboard.SemClipboardManager.mContext
| Field: com.samsung.android.emergencymode.SemEmergencyManager.mContext
| Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
| 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)
We know this is an issue and don't have any plan to address it right now, so let's close it. I updated the issue template to mention it. Will close all future reports with a link to https://github.com/square/leakcanary/wiki/Future#low-memory-leak-analysis
Re-opening this issue for tracking purposes. There are multiple ways to tackle the problem, but until then this is useful. Not everyone may check the issues before posting, but I'd wager even fewer search for closed issues before posting.
👍
FAILURE: java.lang.OutOfMemoryError: Failed to allocate a 2807208 byte allocation with 1575952 free bytes and 1539KB until OOM, max allowed footprint 268435456, growth limit 268435456 at com.squareup.haha.trove.TLongHashSet.rehash(TLongHashSet.java:162) at com.squareup.haha.trove.THash.postInsertHook(THash.java:283) at com.squareup.haha.trove.TLongHashSet.add(TLongHashSet.java:146) at com.squareup.haha.perflib.analysis.TopologicalSort$TopologicalSortVisitor.doVisit(TopologicalSort.java:87) at com.squareup.haha.perflib.analysis.TopologicalSort.compute(TopologicalSort.java:36)
same error on Android 9.0 XiaoMi Device. @pyricau have any plan to fix it?
@hccya can you provide the complete text output? LeakCanary shows a bunch of details, including the version etc.
LeakCanary 2.0 will have a new heap dump parser with a much lower memory footprint. This should make all those OutOfMemoryError crashes go away.
LeakCanary Version: 1.4-beta2