【问题标题】:LeakActivity Leaked showing on Leak CanaryLeakActivity Leaked 显示在 Leak Canary 上
【发布时间】:2019-10-26 07:27:24
【问题描述】:

此活动不是我的应用程序的一部分,它会一直显示在 Leak Canary 应用程序上。

它甚至似乎与我运行的活动以及我是否打开应用程序无关。

在过去 12 小时内,我总共收到了 6 次此消息

有人可以帮助理解它吗?

LibraryLeak(className=leakcanary.internal.activity.LeakActivity, leakTrace=
┬
├─ android.view.ViewGroup$ViewLocationHolder
│    Leaking: NO (a class is never leaking)
│    GC Root: System class
│    ↓ static ViewGroup$ViewLocationHolder.sPool
│                                          ~~~~~
├─ android.util.Pools$SynchronizedPool
│    Leaking: UNKNOWN
│    ↓ Pools$SynchronizedPool.mPool
│                             ~~~~~
├─ java.lang.Object[]
│    Leaking: UNKNOWN
│    ↓ array Object[].[0]
│                     ~~~
├─ android.view.ViewGroup$ViewLocationHolder
│    Leaking: UNKNOWN
│    ↓ ViewGroup$ViewLocationHolder.mRoot
│                                   ~~~~~
├─ android.widget.ListView
│    Leaking: YES (View.mContext references a destroyed activity)
│    mContext instance of leakcanary.internal.activity.LeakActivity with mDestroyed = true
│    View#mParent is set
│    View#mAttachInfo is null (view detached)
│    View.mWindowAttachCount = 1
│    ↓ ListView.mContext
╰→ leakcanary.internal.activity.LeakActivity
​     Leaking: YES (ListView↑ is leaking and Activity#mDestroyed is true and ObjectWatcher was watching this)
​     key = 53dca871-cc9b-4735-a0fd-98d21465fce0
​     watchDurationMillis = 14202
​     retainedDurationMillis = 9201
, retainedHeapByteSize=132349, pattern=instance field android.view.ViewGroup$ViewLocationHolder#mRoot, description=In Android P, ViewLocationHolder has an mRoot field that is not cleared in its clear() method. Introduced in https://github.com/aosp-mirror/platform_frameworks_base/commit/86b326012813f09d8f1de7d6d26c986a909d Bug report: https://issuetracker.google.com/issues/112792715)```

【问题讨论】:

    标签: leakcanary


    【解决方案1】:

    这是 Android 框架 (ViewGroup.ViewLocationHolder) 中的一个已知泄漏:https://github.com/square/leakcanary/issues/1081

    LeakCanary 实际上是这样识别的,这就是为什么它被报告为“LibraryLeak”的原因。请参阅该线程以了解可能修复它的方法(这很难,因为它是 android 框架中的一个错误)。

    【讨论】:

    • 谢谢。奇怪的是,我在谷歌上找不到“LeakActivity Leaked”。
    猜你喜欢
    • 1970-01-01
    • 2017-12-16
    • 2020-07-10
    • 2016-09-30
    • 2019-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多