mattttvaughn / chronicle

GNU General Public License v3.0
217 stars 60 forks source link

Memory Leak #16

Open jt196 opened 2 years ago

jt196 commented 2 years ago

I'm getting some warnings on my Calyx phone Matt, it has leakcanary set up on it, but beyond that I can't say much. Screenshot_20211123-131116.

Here's the analysis result if that helps at all. There's a 125MB .hprof file as well, but I won't bother uploading it unless you think it's useful to debugging this.

I'm running v0.45.1 that's been compiled by myself as per the instructions I left on the Reddit post.

====================================
HEAP ANALYSIS RESULT
====================================
1 APPLICATION LEAKS

References underlined with "~~~" are likely causes.
Learn more at https://squ.re/leaks.

689197 bytes retained by leaking objects
Signature: 79170716aa65b82c7782651d536b45b9aef6332
┬───
│ GC Root: System class
│
├─ android.provider.FontsContract class
│    Leaking: NO (ChronicleApplication↓ is not leaking and a class is never leaking)
│    ↓ static FontsContract.sContext
├─ io.github.mattpvaughn.chronicle.application.ChronicleApplication instance
│    Leaking: NO (Application is a singleton)
│    ↓ ChronicleApplication.plexConfig
│                           ~~~~~~~~~~
├─ io.github.mattpvaughn.chronicle.data.sources.plex.PlexConfig instance
│    Leaking: UNKNOWN
│    ↓ PlexConfig._isConnected
│                 ~~~~~~~~~~~~
├─ androidx.lifecycle.MutableLiveData instance
│    Leaking: UNKNOWN
│    ↓ MutableLiveData.mObservers
│                      ~~~~~~~~~~
├─ androidx.arch.core.internal.SafeIterableMap instance
│    Leaking: UNKNOWN
│    ↓ SafeIterableMap.mStart
│                      ~~~~~~
├─ androidx.arch.core.internal.SafeIterableMap$Entry instance
│    Leaking: UNKNOWN
│    ↓ SafeIterableMap$Entry.mNext
│                            ~~~~~
├─ androidx.arch.core.internal.SafeIterableMap$Entry instance
│    Leaking: UNKNOWN
│    ↓ SafeIterableMap$Entry.mNext
│                            ~~~~~
├─ androidx.arch.core.internal.SafeIterableMap$Entry instance
│    Leaking: UNKNOWN
│    ↓ SafeIterableMap$Entry.mKey
│                            ~~~~
├─ io.github.mattpvaughn.chronicle.features.bookdetails.AudiobookDetailsViewModel$networkObserver$1 instance
│    Leaking: UNKNOWN
│    Anonymous class implementing androidx.lifecycle.Observer
│    ↓ AudiobookDetailsViewModel$networkObserver$1.this$0
│                                                  ~~~~~~
├─ io.github.mattpvaughn.chronicle.features.bookdetails.AudiobookDetailsViewModel instance
│    Leaking: UNKNOWN
│    ↓ AudiobookDetailsViewModel.progressUpdater
│                                ~~~~~~~~~~~~~~~
├─ io.github.mattpvaughn.chronicle.features.player.SimpleProgressUpdater instance
│    Leaking: UNKNOWN
│    ↓ SimpleProgressUpdater.serviceScope
│                            ~~~~~~~~~~~~
├─ androidx.lifecycle.LifecycleCoroutineScopeImpl instance
│    Leaking: UNKNOWN
│    ↓ LifecycleCoroutineScopeImpl.lifecycle
│                                  ~~~~~~~~~
├─ androidx.lifecycle.LifecycleRegistry instance
│    Leaking: UNKNOWN
│    ↓ LifecycleRegistry.mObserverMap
│                        ~~~~~~~~~~~~
├─ androidx.arch.core.internal.FastSafeIterableMap instance
│    Leaking: UNKNOWN
│    ↓ FastSafeIterableMap.mStart
│                          ~~~~~~
├─ androidx.arch.core.internal.SafeIterableMap$Entry instance
│    Leaking: UNKNOWN
│    ↓ SafeIterableMap$Entry.mKey
│                            ~~~~
├─ androidx.activity.ComponentActivity$3 instance
│    Leaking: UNKNOWN
│    Anonymous class implementing androidx.lifecycle.LifecycleEventObserver
│    ↓ ComponentActivity$3.this$0
│                          ~~~~~~
╰→ io.github.mattpvaughn.chronicle.application.MainActivity instance
​     Leaking: YES (ObjectWatcher was watching this because io.github.mattpvaughn.chronicle.application.MainActivity received Activity#onDestroy() callback and Activity#mDestroyed is true)
​     key = 616cb080-c55c-4af7-89fe-053e4dac938f
​     watchDurationMillis = 9882
​     retainedDurationMillis = 4882
====================================
0 LIBRARY LEAKS

A Library Leak is a leak caused by a known bug in 3rd party code that you do not have control over.
See https://square.github.io/leakcanary/fundamentals-how-leakcanary-works/#4-categorizing-leaks
====================================
METADATA

Please include this in bug reports and Stack Overflow questions.

Build.VERSION.SDK_INT: 30
Build.MANUFACTURER: Google
LeakCanary version: 2.4
App process name: io.github.mattpvaughn.chronicle.debug
Analysis duration: 20270 ms
Heap dump file path: /storage/emulated/0/Download/leakcanary-io.github.mattpvaughn.chronicle.debug/2021-11-23_12-42-10_401.hprof
Heap dump timestamp: 1637671358691
====================================