AnyMemo icon indicating copy to clipboard operation
AnyMemo copied to clipboard

Are the leaks caused by the app or AOSP?

Open mjblackhorse opened this issue 8 years ago • 2 comments

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

mjblackhorse avatar Dec 22 '16 02:12 mjblackhorse

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.

helloworld1 avatar Dec 26 '16 04:12 helloworld1

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 [email protected]:

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- .

mjblackhorse avatar Dec 29 '16 08:12 mjblackhorse