Вот полный след утечки, который я получил от LeakCanary. Это, кажется, исходит от fragment
, который содержит GoogleMap
. Я запутался, потому что в GoogleMap fragment
нет RecyclerView
. GoogleMap fragment
- это один из трех fragments
в приложении Android
. A RecyclerView
используется в двух других.
LibraryLeak(className=androidx.constraintlayout.widget.ConstraintLayout, leakTrace=
┬
├─ android.view.inputmethod.InputMethodManager
│ Leaking: NO (InputMethodManager↓ is not leaking and a class is never leaking)
│ GC Root: System class
│ ↓ static InputMethodManager.sInstance
├─ android.view.inputmethod.InputMethodManager
│ Leaking: NO (InputMethodManager is a singleton)
│ ↓ InputMethodManager.mNextServedView
│ ~~~~~~~~~~~~~~~
├─ androidx.recyclerview.widget.RecyclerView
│ Leaking: YES (View detached and has parent)
│ mContext instance of com.example.surfbait30.MainActivity with mDestroyed = false
│ View#mParent is set
│ View#mAttachInfo is null (view detached)
│ View.mWindowAttachCount = 1
│ ↓ RecyclerView.mParent
├─ android.widget.LinearLayout
│ Leaking: YES (RecyclerView↑ is leaking and View detached and has parent)
│ mContext instance of com.example.surfbait30.MainActivity with mDestroyed = false
│ View#mParent is set
│ View#mAttachInfo is null (view detached)
│ View.mWindowAttachCount = 1
│ ↓ LinearLayout.mParent
╰→ androidx.constraintlayout.widget.ConstraintLayout
Leaking: YES (LinearLayout↑ is leaking and ObjectWatcher was watching this)
mContext instance of com.example.surfbait30.MainActivity with mDestroyed = false
View#mParent is null
View#mAttachInfo is null (view detached)
View.mWindowAttachCount = 1
key = 0fbb38f9-458e-4e79-a784-7e3ca197f5d3
watchDurationMillis = 13927
retainedDurationMillis = 8925