question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LeakCanary reports a leak

See original GitHub issue

Describe 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:

  1. Go to ‘LAUNCH CHUCKER DIRECTLY’
  2. Click on ‘Back Button’
  3. 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

2019-08-23_10-25-44_445.hprof.zip

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
mrenoufcommented, Sep 9, 2019
3reactions
vbuberencommented, Jan 7, 2020

It seems to be not Chucker issue: https://github.com/square/leakcanary/issues/1594

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found