DEPRECATED Java library to automate the analysis of Android heap dumps.
DEPRECATED Java library to automate the analysis of Android heap dumps.
“Ha Ha!” - Nelson
com.squareup.leakcanary:leakcanary-haha:2.0-alpha-1.HAHA is a Java library to automate the analysis of Android heap dumps.
This project is essentially a repackaging of the work of others to make it available as a small footprint Maven dependency.
To learn how to dump the heap, read the Android documentation. Here's an example:
File heapDumpFile = ...
Debug.dumpHprofData(heapDumpFile.getAbsolutePath());After dumping the heap, use HAHA to parse and analyze it.
DataBuffer buffer = new MemoryMappedFileBuffer(heapDumpFile);
Snapshot snapshot = Snapshot.createSnapshot(buffer);
// The rest is up to you.
ClassObj someClass = snapshot.findClass("com.example.SomeClass");dependencies {
compile 'com.squareup.haha:haha:2.1'
}bc5c698efaf970f599e877a8b26de16736db4272 SHA of the android_platform_tool_base repo.HprofParser.java to fix https://issuetracker.google.com/issues/122713143.This release separates out Trove4j from HAHA since Trove4j is available under LGPL 2.1 and HAHA is available under Apache 2.
mvn release:prepare && mvn release:perform
No open issues yet, or sync has not completed.