Leakcanary: LeakActivity leaks on Android 10

Created on 21 Sep 2019  Β·  9Comments  Β·  Source: square/leakcanary

Description

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)

Steps to Reproduce

  1. Build app with LeakCanary dependencies, open 'Leaks' app and use back button to exit

Expected behavior: Activity does not leak

Version Information

  • LeakCanary version: 2.0-beta-3
  • Android OS version: 10
  • Gradle version: 5.6.2

Additional Information

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.

bug

Most helpful comment

That's true man :) Here is what I could think of:

  • ignored
  • known
  • reported
  • system (caused by the system, cannot be fixed)
  • suppressed

All 9 comments

πŸ™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 /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:

  • ignored
  • known
  • reported
  • system (caused by the system, cannot be fixed)
  • suppressed
Was this page helpful?
0 / 5 - 0 ratings