LeakActivity leaks on Android 10 due to known IRequestFinishCallback issue.
ApplicationLeak(className=leakcanary.internal.activity.LeakActivity, leakTrace=
β¬
ββ android.app.Activity$1
β Leaking: UNKNOWN
β Anonymous subclass of android.app.IRequestFinishCallback$Stub
β GC Root: Global variable in native code
β β Activity$1.this$0
β ~~~~~~
β°β leakcanary.internal.activity.LeakActivity
β Leaking: YES (Activity#mDestroyed is true and ObjectWatcher was watching this)
β key = c5a0cfcc-d1ed-4aba-9037-9340c66a6ef3
β watchDurationMillis = 5226
β retainedDurationMillis = 210
, retainedHeapByteSize=126160)
Expected behavior: Activity does not leak
A Googler marked the leak as fixed on the issue tracker saying the fix will be included in the next system update so maybe this is not worth adding workarounds for.
πThank you for opening an issue! LeakCanary is maintained by @pyricau with help from the community. Please be kind and remember that LeakCanary isn't anyone's main job π.
Happens to me too.
We should definitely add it to https://github.com/square/leakcanary/blob/master/shark-android/src/main/java/shark/AndroidReferenceMatchers.kt
We should definitely add it to /shark-android/src/main/java/shark/AndroidReferenceMatchers.kt@
master
Opened #1608 adding the leak
@pyricau Sorry if that's a wrong place to ask. I use awesome version 2.0 and the same leak is reported for a custom Activity. Shouldn't it be anyhow marked as "known" or "ignored"?
@beworker The UI should say "library leak", which is the same as "known" or "ignored". 2.1 will surface that information better. In 2.0 it should be more obvious in the text leaktrace. Let me know if that's not the case and share a leaktrace + hprof if possible, it's possible we missed something
@pyricau You're right, it says "Library Leak". Not an issue then, thanks for explaining!
Ironically, the custom Activity I was talking about belongs to a sample app of a library and there is also a "library" module in the project. I was a bit confused by that "Library" word and couldn't map the leak clearly. Now it's good.
Ha! It's hard to find the proper word for these leaks :)
That's true man :) Here is what I could think of:
Most helpful comment
That's true man :) Here is what I could think of: