LeakCanary reports a leak
See original GitHub issueDescribe the bug
LeakCanary reports a leak of MainActivity
. I’ve been able to reproduce it in my own application and in the sample app. It doesn’t matter if there are captured network requests or not.
To Reproduce Steps to reproduce the behavior using the sample app:
- Go to ‘LAUNCH CHUCKER DIRECTLY’
- Click on ‘Back Button’
- See error either in logcat or in LeakCanary UI
Screenshots LeakCanary result in logcat:
┬
├─ android.app.Activity$1
│ Leaking: UNKNOWN
│ Anonymous subclass of android.app.IRequestFinishCallback$Stub
│ GC Root: Global variable in native code
│ ↓ Activity$1.this$0
│ ~~~~~~
╰→ com.chuckerteam.chucker.api.internal.ui.MainActivity
Leaking: YES (Activity#mDestroyed is true and ObjectWatcher was watching this)
key = 3d3901ea-a7b9-47fa-ba5a-566d1ede5924
watchDurationMillis = 5185
retainedDurationMillis = 178
, retainedHeapByteSize=165749)], libraryLeaks=[])
Smartphone
- Device: Pixel 3XL
- OS: Android Q Beta6
- Lib version: 3.0.1 and
develop
branch
Additional context I haven’t being able to reproduce it in other android versions. I suppose this is happening due to Android Q but I don’t know if it’s a false positive from LeakCanary or not. I’ve attached the memory dump from LeakCanary
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
How LeakCanary works - Square Open Source
Once LeakCanary is installed, it automatically detects and report memory leaks, in 4 steps: Detecting retained objects. Dumping the heap.
Read more >LeakCanary
LeakCanary is a memory leak detection library for Android. LeakCanary's knowledge of the internals of the Android Framework gives it a unique ability...
Read more >Leak detection in UI tests - LeakCanary
Running leak detection in UI tests means you can detect memory leaks automatically in Continuous Integration prior to new leaks being merged into...
Read more >Uploading analysis results - LeakCanary
A memory leak detection library for Android. ... Create a Bugsnag account, create a new project for leak reporting and grab an API...
Read more >Fixing a memory leak - LeakCanary
A memory leak is a programming error that causes an application to keep a reference to an object that is no longer needed....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is a framework issue: https://issuetracker.google.com/issues/139738913
It seems to be not Chucker issue: https://github.com/square/leakcanary/issues/1594