public class HeapDumper extends Object
Usage: HeapDumper.dumpHeap("/tmp/foo.hprof");
If the file exists already, it will be replaced.
Courtesy: https://blogs.oracle.com/sundararajan/entry/programmatically_dumping_heap_from_java
See https://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean.html#dumpHeap-java.lang.String-boolean-
| Modifier and Type | Method and Description |
|---|---|
static void |
dumpHeap(String fileName) |
static void |
dumpHeap(String fileName,
boolean live) |