使用泄漏金丝雀进行Android内存泄漏测试

时间:2017-04-26 17:03:53

标签: android memory-leaks leakcanary

我看到这个图标在屏幕上多次弹出。该应用程序没有崩溃,但我得到这个弹出窗口说应用程序将冻结一段时间。

Brrr! App will freeze for some time

还在日志上说......

在com。***。android:1.0.1:1。*失败在1.5 00f37f5:java.lang.OutOfMemoryError:无法分配1191492字节分配141738个空闲字节和138KB直到OOMat 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)com.squareup.haak.perflib.Snapshot.computeDominators(Snapshot.java:311)at com.squareup.leakcanary.HeapAnalyzer.findLeakTrace(HeapAnalyzer.java:187)at com.squareup.leakcanary.HeapAnalyzer.checkForLeak( HeapAnalyzer.java:122)at.com.supup.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:135)在android.os.HandlerThread.run(HandlerThread.java:61)*参考密钥:010554da-4ffc-41c 4-b0b3-ee5d12989a31 *设备:Xiaomi Xiaomi 2014818 2014818 * Android版本:5.1.1 API:22 LeakCanary:1.5 00f37f5 *持续时间:watch = 5829ms,gc = 202ms,堆转储= 4019ms,分析= 292701ms *排除参考:|字段:android.view.inputmethod.InputMethodManager.mNextServedView |字段:android.view.inputmethod.InputMethodManager.mServedView |字段:android.view.inputmethod.InputMethodManager.mServedInputConnection |字段:android.view.inputmethod.InputMethodManager.mCurRootView |字段:android.animation.LayoutTransition $ 1.val $ parent |字段:android.view.textservice.SpellCheckerSession $ 1.this $ 0 |字段:android.support.v7.internal.widget.ActivityChooserModel.mActivityChoserModelPolicy |字段:android.widget.ActivityChooserModel.mActivityChoserModelPolicy |字段:android.accounts.AccountManager $ AmsTask $ Response.this $ 1 |字段:android.media.MediaScannerConnection.mContext |字段:android.os.UserManager.mContext |字段:android.media.AudioManager $ 1.this $ 0 |字段:android.widget.Editor $ Blink.this $ 0 |字段:android.net.ConnectivityManager.sInstance |字段:android.view.Choreographer $ FrameDisplayEventReceiver.mMessageQueue(always)|静态字段:android.text.TextLine.sCached |线程:FinalizerWatchdogDaemon(总是)|线程:主(总是)|线程:LeakCanary-Heap-Dump(总是)|类:java.lang.ref.WeakReference(always)|类:java.lang.ref.SoftReference(always)|类:java.lang.ref.PhantomReference(always)|类:java.lang.ref.Finalizer(总是)|类:java.lang.ref.FinalizerReference(always)

1 个答案:

答案 0 :(得分:1)

LeakCanary检测到内存泄漏。

Here是一些关于LeakCanary的常见问题