kiwix-android
kiwix-android copied to clipboard
Leaks on Application
trafficstars
I don't know how to reproduce this bug but I found it two times in my kiwix application when I was playing with applications. Logs
D:
D: ┬───
D: │ GC Root: System class
D: │
D: ├─ android.view.inputmethod.InputMethodManager class
D: │ Leaking: NO (InputMethodManager↓ is not leaking and a class is never leaking)
D: │ ↓ static InputMethodManager.sInstance
D: ├─ android.view.inputmethod.InputMethodManager instance
D: │ Leaking: NO (DecorView↓ is not leaking and InputMethodManager is a singleton)
D: │ ↓ InputMethodManager.mCurRootView
D: ├─ com.android.internal.policy.DecorView instance
D: │ Leaking: NO (View attached)
D: │ View is part of a window view hierarchy
D: │ View.mAttachInfo is not null (view attached)
D: │ View.mWindowAttachCount = 1
D: │ mContext instance of com.android.internal.policy.DecorContext, wrapping activity org.kiwix.kiwixmobile.main.
D: │ KiwixMainActivity with mDestroyed = false
D: │ ↓ DecorView.mAttachInfo
D: │ ~~~~~~~~~~~
D: ├─ android.view.View$AttachInfo instance
D: │ Leaking: UNKNOWN
D: │ Retaining 427153 bytes in 7705 objects
D: │ ↓ View$AttachInfo.mTreeObserver
D: │ ~~~~~~~~~~~~~
D: ├─ android.view.ViewTreeObserver instance
D: │ Leaking: UNKNOWN
D: │ Retaining 422860 bytes in 7663 objects
D: │ ↓ ViewTreeObserver.mOnPreDrawListeners
D: │ ~~~~~~~~~~~~~~~~~~~
D: ├─ android.view.ViewTreeObserver$CopyOnWriteArray instance
D: │ Leaking: UNKNOWN
D: │ Retaining 422700 bytes in 7658 objects
D: │ ↓ ViewTreeObserver$CopyOnWriteArray.mData
D: │ ~~~~~
D: ├─ java.util.ArrayList instance
D: │ Leaking: UNKNOWN
D: │ Retaining 422663 bytes in 7656 objects
D: │ ↓ ArrayList.elementData
D: │ ~~~~~~~~~~~
D: ├─ java.lang.Object[] array
D: │ Leaking: UNKNOWN
D: │ Retaining 422643 bytes in 7655 objects
D: │ ↓ Object[].[1]
D: │ ~~~
D: ├─ uC instance
D: │ Leaking: UNKNOWN
D: │ Retaining 12 bytes in 1 objects
D: │ ↓ uC.w
D: │ ~
D: ├─ wC instance
D: │ Leaking: UNKNOWN
D: │ Retaining 92 bytes in 4 objects
D: │ ↓ wC.a
D: │ ~
D: ├─ org.kiwix.kiwixmobile.core.main.ToolbarScrollingKiwixWebView instance
D: │ Leaking: UNKNOWN
D: │ Retaining 422371 bytes in 7644 objects
D: │ View not part of a window view hierarchy
D: │ View.mAttachInfo is null (view detached)
D: │ View.mWindowAttachCount = 1
D: │ mContext instance of org.kiwix.kiwixmobile.main.KiwixMainActivity with mDestroyed = false
D: │ ↓ ToolbarScrollingKiwixWebView.videoEnabledWebChromeClient
D: │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
D: ├─ org.kiwix.kiwixmobile.core.main.KiwixWebChromeClient instance
D: │ Leaking: UNKNOWN
D: │ Retaining 56 bytes in 2 objects
D: │ ↓ KiwixWebChromeClient.activityNonVideoView
D: │ ~~~~~~~~~~~~~~~~~~~~
D: ├─ androidx.constraintlayout.widget.ConstraintLayout instance
D: │ Leaking: UNKNOWN
D: │ Retaining 2108 bytes in 32 objects
D: │ View not part of a window view hierarchy
D: │ View.mAttachInfo is null (view detached)
D: │ View.mID = R.id.activity_main_root
D: │ View.mWindowAttachCount = 1
D: │ mContext instance of org.kiwix.kiwixmobile.main.KiwixMainActivity with mDestroyed = false
D: │ ↓ ConstraintLayout.mParent
D: │ ~~~~~~~
D: ├─ androidx.constraintlayout.widget.ConstraintLayout instance
D: │ Leaking: UNKNOWN
D: │ Retaining 3961 bytes in 90 objects
D: │ View not part of a window view hierarchy
D: │ View.mAttachInfo is null (view detached)
D: │ View.mWindowAttachCount = 1
D: │ mContext instance of org.kiwix.kiwixmobile.main.KiwixMainActivity with mDestroyed = false
D: │ ↓ ConstraintLayout.mParent
D: │ ~~~~~~~
D: ╰→ androidx.drawerlayout.widget.DrawerLayout instance
D: Leaking: YES (ObjectWatcher was watching this because org.kiwix.kiwixmobile.nav.destination.reader.
D: KiwixReaderFragment received Fragment#onDestroyView() callback (references to its views should be cleared to
D: prevent leaks))
D: Retaining 2516 bytes in 64 objects
D: key = 2351983a-29ff-4ec5-9545-0c633d7ddb0c
D: watchDurationMillis = 8820
D: retainedDurationMillis = 3818
D: View not part of a window view hierarchy
D: View.mAttachInfo is null (view detached)
D: View.mID = R.id.navigation_fragment_main_drawer_layout
D: View.mWindowAttachCount = 1
D: mContext instance of org.kiwix.kiwixmobile.main.KiwixMainActivity with mDestroyed = false
@kelson42 Since the reproducing steps are unknown. We can move this to 3.5.
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
hi @gouri-panda , @kelson42
I am able to reproduce this memory leak. I have placed a fix for it in https://github.com/kiwix/kiwix-android/pull/3158. Also, I have updated the description how to reproduce this memory leak.