public class HeapDumper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HEAP_DUMP_EXTENSION
Filename extension for heap dumps
|
private static java.lang.String |
HOTSPOT_BEAN_NAME
The name of the HotSpot Diagnostic MBean
|
private static com.sun.management.HotSpotDiagnosticMXBean |
hotSpotDiagnosticMBean
HotSpot diagnostic MBean
|
Constructor and Description |
---|
HeapDumper() |
Modifier and Type | Method and Description |
---|---|
static void |
dumpHeap(java.io.File file,
boolean live)
Dump the heap snapshot into a file.
|
private static com.sun.management.HotSpotDiagnosticMXBean |
getHotSpotDiagnosticMBean()
Get HotSpot diagnostic MBean
|
private static final java.lang.String HOTSPOT_BEAN_NAME
public static final java.lang.String HEAP_DUMP_EXTENSION
private static volatile com.sun.management.HotSpotDiagnosticMXBean hotSpotDiagnosticMBean
public static void dumpHeap(java.io.File file, boolean live) throws java.lang.ClassNotFoundException
file
- The file in which the dump will be storedlive
- Dump only live objects?java.lang.ClassNotFoundException
private static com.sun.management.HotSpotDiagnosticMXBean getHotSpotDiagnosticMBean()