Package org.plumelib.util
Class DumpHeap
java.lang.Object
org.plumelib.util.DumpHeap
Defines a static method
dumpHeap(java.lang.String) that dumps the heap to an .hprof file.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDumps a heap snapshot (of only the live objects) into a file.static voidDumps a heap snapshot into a file.private static voidInitialize the fields of this class.
-
Field Details
-
hotspotMBean
The HotSpot Diagnostic MBean. Its type is Object, in case HotSpotDiagnosticMXBean is not available at compile time. -
dumpHeapMethod
The method com.sun.management.HotSpotDiagnosticMXBean#dumpHeap.
-
-
Constructor Details
-
DumpHeap
private DumpHeap()Do not instantiate.
-
-
Method Details
-
initializeFields
@EnsuresNonNull({"hotspotMBean","dumpHeapMethod"}) private static void initializeFields()Initialize the fields of this class. -
dumpHeap
Dumps a heap snapshot (of only the live objects) into a file.- Parameters:
fileName- file into which to dump a heap snapshot; is overwritten if it exists
-
dumpHeap
Dumps a heap snapshot into a file.- Parameters:
fileName- file into which to dump a heap snapshot; is overwritten if it existslive- if true, dump only the live objects
-