Could not dump heap, previous analysis still is in progress.
See original GitHub issueMore 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:
- Created 6 years ago
- Reactions:13
- Comments:29 (4 by maintainers)
Top 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 >
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 Free
Top 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
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 moduledebugImplementation project(':leakcanary-android')
releaseImplementation project(':leakcanary-android-no-op')
It will be ok. That can reproduce this issue.This issue is closed. If you’re experiencing something that seems similar, please open a new issue with a sample project that reproduces.