helloworld1 / AnyMemo

Advanced Spaced Repetition flashcard learning software for Android.
http://www.anymemo.org
GNU General Public License v2.0
151 stars 53 forks source link

Are the leaks caused by the app or AOSP? #417

Open mjblackhorse opened 7 years ago

mjblackhorse commented 7 years ago

Hi, according to the report, DownloaderAnyMemo and DownloadTabFragment leaked! My testing were run on an emulator with Android 22. However according to https://github.com/square/leakcanary/blob/master/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java

These match leak patterns "BLOCKING_QUEUE“. But LeakCanary believe this pattern only happens with (SDK_INT < LOLLIPOP) , while my testing emulator ran Android 22.

I thought LeakCanary might be mis-configured for this pattern. But I am not sure. So I report this, as I am not should are these leaks caused by your app or AOSP.

image image the Heap file (in .rar format): heap_0.txt

helloworld1 commented 7 years ago

All those leaks seems to be related to AsyncTask. I don't think I used incorrectly. All AsyncTasks are short-lived. Also DownloaderTabFragment is so simple. I couldn't think any source of leak: https://github.com/helloworld1/AnyMemo/blob/master/app/src/main/java/org/liberty/android/fantastischmemo/ui/DownloadTabFragment.java The fragment is also completely controlled by TabLayout: https://github.com/helloworld1/AnyMemo/blob/master/app/src/main/java/org/liberty/android/fantastischmemo/ui/AnyMemo.java#L443

I don't control the lifecycle my own.

mjblackhorse commented 7 years ago

I reran the app many times, each time I found one instance of DownloaderTabFragment reported as leaked per each .hprof file. I'll try manually run the app targeting at the reported activity/fragment.

2016-12-26 12:19 GMT+08:00 helloworld1 notifications@github.com:

All those leaks seems to be related to AsyncTask. I don't think I used incorrectly. All AsyncTasks are short-lived. Also DownloaderTabFragment is so simple. I couldn't think any source of leak: https://github.com/helloworld1/AnyMemo/blob/master/app/src/main/java/org/ liberty/android/fantastischmemo/ui/DownloadTabFragment.java The fragment is also completely controlled by TabLayout: https://github.com/helloworld1/AnyMemo/blob/master/app/src/main/java/org/ liberty/android/fantastischmemo/ui/AnyMemo.java#L443

I don't control the lifecycle my own.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/helloworld1/AnyMemo/issues/417#issuecomment-269159258, or mute the thread https://github.com/notifications/unsubscribe-auth/ANL37zOZcP8cx2rT6BRNanLSaf_lNUU2ks5rL0BhgaJpZM4LTk9- .