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.

Could not dump heap, previous analysis still is in progress.

See original GitHub issue

More than ten minutes. Android Studio 3.0.1, Android 5.1.1 or 7.1.1 .

public class MyApplication extends Application {
    private RefWatcher refWatcher;

    @Override
    public void onCreate() {
        super.onCreate();
        if (LeakCanary.isInAnalyzerProcess(this)) {
            // This process is dedicated to LeakCanary for heap analysis.
            // You should not init your app in this process.
            return;
        }
        refWatcher=LeakCanary.install(this);
    }

    public static RefWatcher getRefWatcher(Context context){
        MyApplication myApplication= (MyApplication) context.getApplicationContext();
        return myApplication.refWatcher;
    }
}

in Activity class

   @Override
    protected void onDestroy() {
        super.onDestroy();
        MyApplication.getRefWatcher(getApplicationContext()).watch(Main2Activity.this);
    }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:13
  • Comments:29 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cuishuocommented, Jun 21, 2018

In demo, if I use debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4' releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' It will prompt “Could not dump heap, previous analysis still is in progress.” if I import module debugImplementation project(':leakcanary-android') releaseImplementation project(':leakcanary-android-no-op') It will be ok. That can reproduce this issue.

0reactions
pyricaucommented, Jan 10, 2019

This issue is closed. If you’re experiencing something that seems similar, please open a new issue with a sample project that reproduces.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why LeakCanary reports about leak of each activity's field ...
Could not dump heap, previous analysis still is in progress. In com.daxh.explore.myapp:0.3:3. * java.lang.String has leaked: * GC ROOT ...
Read more >
Code recipes - LeakCanary
dumpHeap to false , AppWatcher.objectWatcher will still keep track of retained objects, and LeakCanary will look for these objects when you change ...
Read more >
Troubleshooting Memory Leaks - Oracle Help Center
Another way to obtain a heap dump is with the JConsole utility. In the MBeans tab, select the HotSpotDiagnostic MBean, then the Operations...
Read more >
dumpsys - Android Developers
Call dumpsys from the command line using the Android Debug Bridge ... If the device does not have a built-in keyboard, then the...
Read more >
android.os.Debug.dumpHprofData java code examples
dumpHprofData appears to hang if it cannot write // to the target location on ART. ... "Could not dump heap, previous analysis still...
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