Leak Canary: Thread.threadLocals
I got a leak detected from the leak canary, this is what it provided for the leak trace. Do you need the heap dump to further debug it?
┬───
│ GC Root: Thread object
│
├─ java.lang.Thread instance
│ Leaking: NO (the main thread always runs)
│ Thread name: 'main'
│ ↓ Thread.threadLocals
│ ~~~~~~~~~~~~
├─ java.lang.ThreadLocal$ThreadLocalMap instance
│ Leaking: UNKNOWN
│ Retaining 18.6 MB in 10385 objects
│ ↓ ThreadLocal$ThreadLocalMap.table
│ ~~~~~
├─ java.lang.ThreadLocal$ThreadLocalMap$Entry[] array
│ Leaking: UNKNOWN
│ Retaining 18.6 MB in 10384 objects
│ ↓ ThreadLocal$ThreadLocalMap$Entry[18]
│ ~~~~
├─ java.lang.ThreadLocal$ThreadLocalMap$Entry instance
│ Leaking: UNKNOWN
│ Retaining 18.6 MB in 10301 objects
│ ↓ ThreadLocal$ThreadLocalMap$Entry.value
│ ~~~~~
├─ android.animation.AnimationHandler instance
│ Leaking: UNKNOWN
│ Retaining 18.6 MB in 10300 objects
│ ↓ AnimationHandler.mPausedAnimators
│ ~~~~~~~~~~~~~~~~
├─ java.util.ArrayList instance
│ Leaking: UNKNOWN
│ Retaining 18.6 MB in 10290 objects
│ ↓ ArrayList[0]
│ ~~~
├─ android.animation.AnimatorSet instance
│ Leaking: UNKNOWN
│ Retaining 18.6 MB in 10288 objects
│ mListeners = null
│ ↓ AnimatorSet.mNodeMap
│ ~~~~~~~~
├─ android.util.ArrayMap instance
│ Leaking: UNKNOWN
│ Retaining 73 B in 3 objects
│ ↓ ArrayMap.mArray
│ ~~~~~~
├─ java.lang.Object[] array
│ Leaking: UNKNOWN
│ Retaining 32 B in 1 objects
│ ↓ Object[0]
│ ~~~
├─ android.animation.ValueAnimator instance
│ Leaking: UNKNOWN
│ Retaining 467 B in 16 objects
│ mListeners = null
│ ↓ ValueAnimator.mUpdateListeners
│ ~~~~~~~~~~~~~~~~
├─ java.util.ArrayList instance
│ Leaking: UNKNOWN
│ Retaining 72 B in 3 objects
│ ↓ ArrayList[0]
│ ~~~
├─ org.torproject.vpn.utils.
│ GradientGlowView$AnimatedColorConfig$$ExternalSyntheticLambda1 instance
│ Leaking: UNKNOWN
│ Retaining 12 B in 1 objects
│ ↓ GradientGlowView$AnimatedColorConfig$$ExternalSyntheticLambda1.f$0
│ ~~~
├─ org.torproject.vpn.utils.GradientGlowView$AnimatedColorConfig instance
│ Leaking: UNKNOWN
│ Retaining 60 B in 2 objects
│ ↓ GradientGlowView$AnimatedColorConfig.this$0
│ ~~~~~~
├─ org.torproject.vpn.utils.GradientGlowView instance
│ Leaking: YES (View.mContext references a destroyed activity)
│ Retaining 18.6 MB in 9984 objects
│ View not part of a window view hierarchy
│ View.mAttachInfo is null (view detached)
│ View.mID = R.id.gradient_view
│ View.mWindowAttachCount = 1
│ mContext instance of org.torproject.vpn.MainActivity with mDestroyed = true
│ ↓ View.mContext
╰→ org.torproject.vpn.MainActivity instance
Leaking: YES (ObjectWatcher was watching this because org.torproject.vpn.
MainActivity received Activity#onDestroy() callback and
Activity#mDestroyed is true)
Retaining 138.9 kB in 2574 objects
key = 245849aa-4e16-4cf9-8985-9cc00cb2e4a5
watchDurationMillis = 5390
retainedDurationMillis = 390
mApplication instance of org.torproject.vpn.TorApplication
mBase instance of androidx.appcompat.view.ContextThemeWrapper
METADATA
Build.VERSION.SDK_INT: 34
Build.MANUFACTURER: Google
LeakCanary version: 2.9.1
App process name: org.torproject.vpn
Class count: 27709
Instance count: 509436
Primitive array count: 254699
Object array count: 28669
Thread count: 46
Heap total bytes: 43504213
Bitmap count: 2
Bitmap total bytes: 17975522
Large bitmap count: 1
Large bitmap total bytes: 17971201
Count of retained yet cleared: 1 KeyedWeakReference instances
Stats: LruCache[maxSize=3000,hits=217303,misses=487982,hitRate=30%]
RandomAccess[bytes=20574252,reads=487982,travel=457847501442,range=55993181,size
=64745154]
Analysis duration: 1537552 ms
Edited by micah