Java 获取片段中的未知内存泄漏
我正在尝试使用LeakCanary修复内存泄漏,下面是LeakCanary的日志。 我不熟悉内存泄漏,无法理解日志 堆分析结果 ==================================== 1应用程序泄漏Java 获取片段中的未知内存泄漏,java,android,android-fragments,memory-leaks,leakcanary,Java,Android,Android Fragments,Memory Leaks,Leakcanary,我正在尝试使用LeakCanary修复内存泄漏,下面是LeakCanary的日志。 我不熟悉内存泄漏,无法理解日志 堆分析结果 ==================================== 1应用程序泄漏 │ GC Root: System class │ ├─ android.view.ViewRootImpl class │ Leaking: NO (MutedVideoView↓ is not leaking and a class is
│ GC Root: System class
│
├─ android.view.ViewRootImpl class
│ Leaking: NO (MutedVideoView↓ is not leaking and a class is never leaking)
│ ↓ static ViewRootImpl.mCastProjectionCallbacks
├─ java.util.ArrayList instance
│ Leaking: NO (MutedVideoView↓ is not leaking)
│ ↓ ArrayList.elementData
├─ java.lang.Object[] array
│ Leaking: NO (MutedVideoView↓ is not leaking)
│ ↓ Object[].[0]
├─ MutedVideoView instance
│ Leaking: NO (HomeActivity↓ is not leaking and View attached)
│ View is part of a window view hierarchy
│ View.mAttachInfo is not null (view attached)
│ View.mID = R.id.videoview
│ View.mWindowAttachCount = 1
│ mContext instance of HomeActivity with mDestroyed = false
│ ↓ MutedVideoView.mContext
├─ HomeActivity instance
│ Leaking: NO (DashboardFragment↓ is not leaking and Activity#mDestroyed is false)
│ mApplication instance of MyApplication
│ mBase instance of io.github.inflationx.viewpump.ViewPumpContextWrapper, not wrapping known Android context
│ ↓ HomeActivity.mDashboardFragment
├─ DashboardFragment instance
│ Leaking: NO (LinearLayout↓ is not leaking and Fragment#mFragmentManager is not null)
│ mActivityContext instance of HomeActivity with mDestroyed = false
│ mSaveStateCallback instance of HomeActivity with mDestroyed = false
│ ↓ DashboardFragment.mSectionContainer
├─ android.widget.LinearLayout instance
│ Leaking: NO (FrameLayout↓ is not leaking and View attached)
│ View is part of a window view hierarchy
│ View.mAttachInfo is not null (view attached)
│ View.mID = R.id.container
│ View.mWindowAttachCount = 1
│ mContext instance of HomeActivity with mDestroyed = false
│ ↓ LinearLayout.mChildren
├─ android.view.View[] array
│ Leaking: NO (FrameLayout↓ is not leaking)
│ ↓ View[].[3]
├─ android.widget.FrameLayout instance
│ Leaking: NO (View attached)
│ View is part of a window view hierarchy
│ View.mAttachInfo is not null (view attached)
│ View.mID = R.id.null
│ View.mWindowAttachCount = 1
│ mContext instance of HomeActivity with mDestroyed = false
│ ↓ FrameLayout.mKeyedTags
│ ~~~~~~~~~~
├─ android.util.SparseArray instance
│ Leaking: UNKNOWN
│ Retaining 75819 bytes in 473 objects
│ ↓ SparseArray.mValues
│ ~~~~~~~
├─ java.lang.Object[] array
│ Leaking: UNKNOWN
│ Retaining 75786 bytes in 471 objects
│ ↓ Object[].[0]
│ ~~~
╰→ HomeFragment instance Leaking: YES (ObjectWatcher was watching this because HomeFragment received Fragment#onDestroy() callback and Fragment#mFragmentManager is null)
提前谢谢 你找到解决办法了吗?我也遇到了同样的问题: