Java heap dump (HProf format) reader with low memory requirements.
The core module contains headless utilities for low-memory operations on heap dumps:
- parsing heap dumps
- scanning for objects and references
Example usage:
StreamPool file = new MemoryCachedFilePool(new File("dump.hprof"));
Executor executor = Executors.newFixedThreadPool(4);
Indexer indexer = new Indexer(file, executor);
// scan root index (strings, where the actual heap dump is etc)
indexer.scanRootIndex();
// scan the heap dump data found above once to index classes
indexer.scanTypeIndex();
indexer.walkHeapDump(new HeapDumpItemVisitor(true) {
@Override
public boolean visitInstanceHeader(HprofHeapDumpInstanceHeader item) {
TypeData type = indexer.getTypeIndex().get(item.classObjectId);
System.out.println("Found object of type " + type.getName());
return false;
}
});
This module contains a javafx GUI for analyzing heap dumps. Memory usage goals are ~1/3rd of the heap dump size and this works fairly well already (Xmx 3GB, 8GB heap dump):