XPopup
XPopup copied to clipboard
内存泄露问题
`
┬───
│ GC Root: System class
│
├─ android.provider.FontsContract class
│ Leaking: NO (App↓ is not leaking and a class is never leaking)
│ ↓ static FontsContract.sContext
├─ com.djcx.cxbapp.App instance
│ Leaking: NO (ProductFragment↓ is not leaking and Application is a
│ singleton)
│ mBase instance of android.app.ContextImpl
│ ↓ BaseApplication.mAppViewModelStore
├─ androidx.lifecycle.ViewModelStore instance
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ ViewModelStore.mMap
├─ java.util.HashMap instance
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ HashMap.table
├─ java.util.HashMap$Node[] array
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ HashMap$Node[].[0]
├─ java.util.HashMap$Node instance
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ HashMap$Node.value
├─ com.djcx.cxbapp.domain.message.UISharedViewModel instance
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ UISharedViewModel.mainTab
├─ com.kunminx.architecture.ui.callback.UnPeekLiveData instance
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ LiveData.mObservers
├─ androidx.arch.core.internal.SafeIterableMap instance
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ SafeIterableMap.mEnd
├─ androidx.arch.core.internal.SafeIterableMap$Entry instance
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ SafeIterableMap$Entry.mValue
├─ androidx.lifecycle.LiveData$LifecycleBoundObserver instance
│ Leaking: NO (ProductFragment↓ is not leaking)
│ ↓ LiveData$LifecycleBoundObserver.mOwner
├─ com.djcx.cxbapp.ui.main.ProductFragment instance
│ Leaking: NO (Fragment#mFragmentManager is not null)
│ mActivity instance of com.djcx.cxbapp.MainActivity with mDestroyed = false
│ Fragment.mTag=f1
│ ↓ CxbFragment.loading
│ ~~~~~~~
├─ com.lxj.xpopup.impl.LoadingPopupView instance
│ Leaking: YES (View detached yet still part of window view hierarchy)
│ Retaining 43.4 kB in 559 objects
│ View is part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.null
│ View.mWindowAttachCount = 1
│ mContext instance of com.djcx.cxbapp.MainActivity with mDestroyed = false
│ ↓ View.mParent
├─ android.widget.FrameLayout instance
│ Leaking: YES (LoadingPopupView↑ is leaking and View detached yet still
│ part of window view hierarchy)
│ Retaining 28.2 kB in 428 objects
│ View is part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.null
│ View.mWindowAttachCount = 1
│ mContext instance of android.view.ContextThemeWrapper, wrapping activity
│ com.djcx.cxbapp.MainActivity with mDestroyed = false
│ ↓ View.mParent
├─ android.widget.LinearLayout instance
│ Leaking: YES (FrameLayout↑ is leaking and View detached yet still part of
│ window view hierarchy)
│ Retaining 25.9 kB in 404 objects
│ View is part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mWindowAttachCount = 1
│ mContext instance of android.view.ContextThemeWrapper, wrapping activity
│ com.djcx.cxbapp.MainActivity with mDestroyed = false
│ ↓ View.mParent
╰→ com.android.internal.policy.DecorView instance
Leaking: YES (ObjectWatcher was watching this because com.android.
internal.policy.DecorView received View#onDetachedFromWindow() callback)
Retaining 22.1 kB in 381 objects
key = c4493811-1a87-4a56-ad1f-958a77c965a8
watchDurationMillis = 47444
retainedDurationMillis = 42440
View not part of a window view hierarchy
View.mAttachInfo is null (view detached)
View.mWindowAttachCount = 1
mContext instance of android.view.ContextThemeWrapper, wrapping activity
com.djcx.cxbapp.MainActivity with mDestroyed = false
METADATA
Build.VERSION.SDK_INT: 28
Build.MANUFACTURER: HUAWEI
LeakCanary version: 2.6
App process name: com.djcx.cxbapp
Stats: LruCache[maxSize=3000,hits=10709,misses=106104,hitRate=9%]
RandomAccess[bytes=6470561,reads=106104,travel=49994742885,range=32055483,size=3
7698891]
Heap dump reason: 5 retained objects, app is visible
Analysis duration: 8346 ms
代码调用:
if (loading == null)
loading = XPopup.Builder(requireContext()).isDestroyOnDismiss(true).asLoading()
loading?.show()`
是最新版本吗