Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MEMORY LEAK] StartActivity is leaking #2 #536

Closed
K1rakishou opened this issue Jan 29, 2020 · 2 comments
Closed

[MEMORY LEAK] StartActivity is leaking #2 #536

K1rakishou opened this issue Jan 29, 2020 · 2 comments
Assignees

Comments

@K1rakishou
Copy link

ApplicationLeak(className=com.github.adamantcheese.chan.StartActivity, leakTrace=
┬
├─ android.os.HandlerThread
│    Leaking: NO (PathClassLoader↓ is not leaking)
│    Thread name: 'LeakCanary-Heap-Dump'
│    GC Root: Local variable in native code
│    ↓ thread HandlerThread.contextClassLoader
├─ dalvik.system.PathClassLoader
│    Leaking: NO (Object[]↓ is not leaking and A ClassLoader is never leaking)
│    ↓ PathClassLoader.runtimeInternalObjects
├─ java.lang.Object[]
│    Leaking: NO (FastTextView↓ is not leaking)
│    ↓ array Object[].[1170]
├─ com.github.adamantcheese.chan.ui.text.FastTextView
│    Leaking: NO (a class is never leaking)
│    ↓ static FastTextView.textCache
│                          ~~~~~~~~~
├─ android.util.LruCache
│    Leaking: UNKNOWN
│    ↓ LruCache.map
│               ~~~
├─ java.util.LinkedHashMap
│    Leaking: UNKNOWN
│    ↓ LinkedHashMap.tail
│                    ~~~~
├─ java.util.LinkedHashMap$LinkedHashMapEntry
│    Leaking: UNKNOWN
│    ↓ LinkedHashMap$LinkedHashMapEntry.key
│                                       ~~~
├─ com.github.adamantcheese.chan.ui.text.FastTextView$FastTextViewItem
│    Leaking: UNKNOWN
│    ↓ FastTextView$FastTextViewItem.text
│                                    ~~~~
├─ android.text.SpannedString
│    Leaking: UNKNOWN
│    ↓ SpannedString.mSpans
│                    ~~~~~~
├─ java.lang.Object[]
│    Leaking: UNKNOWN
│    ↓ array Object[].[3]
│                     ~~~
├─ com.github.adamantcheese.chan.ui.cell.PostCell$PostNumberClickableSpan
│    Leaking: UNKNOWN
│    ↓ PostCell$PostNumberClickableSpan.this$0
│                                       ~~~~~~
├─ com.github.adamantcheese.chan.ui.cell.PostCell
│    Leaking: YES (View.mContext references a destroyed activity)
│    mContext instance of com.github.adamantcheese.chan.StartActivity with mDestroyed = true
│    View#mParent is set
│    View#mAttachInfo is null (view detached)
│    View.mWindowAttachCount = 1
│    ↓ PostCell.mContext
╰→ com.github.adamantcheese.chan.StartActivity
​     Leaking: YES (PostCell↑ is leaking and Activity#mDestroyed is true and ObjectWatcher was watching this)
​     key = 70eb2157-4ebd-40fa-ad19-456b8df4946a
​     watchDurationMillis = 5285
​     retainedDurationMillis = 271
, retainedHeapByteSize=10056773)
@Adamantcheese
Copy link
Owner

The entry in question is in an LRU Cache, and as such this should not result in a memory leak, as it will eventually be tossed out when it is not used; this should be fairly quickly as every new cell that gets rendered will add to this cache and push out any old, stale entries. I'll decrease the cache size to 75 instead of 250, to speed up how fast old static layouts are thrown out.

@K1rakishou
Copy link
Author

I think we should have probably just clean it up upon closing the app, but whatever. I haven't seen this thing once, myself so I guess it's pretty rare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants