Package adams.core.management
Class HeapDump
- java.lang.Object
-
- adams.core.management.HeapDump
-
public class HeapDump extends Object
Helper class for generating heap dumps. Based on idea from here: https://blogs.oracle.com/sundararajan/programmatically-dumping-heap-from-java-applications- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected static com.sun.management.HotSpotDiagnosticMXBean
DIAGNOSTIC_INSTANCE
the singleton instance.static String
DIAGNOSTIC_NAME
the hotspot bean for generating the dump.protected static boolean
INSTANTIATED
whether the bean has been instantiated.
-
Constructor Summary
Constructors Constructor Description HeapDump()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
generate(File output, boolean live)
Generates a heap dump.protected static String
initDiagnosticBean()
Initializes the diagnostic bean if necessary.
-
-
-
Field Detail
-
DIAGNOSTIC_NAME
public static final String DIAGNOSTIC_NAME
the hotspot bean for generating the dump.- See Also:
- Constant Field Values
-
DIAGNOSTIC_INSTANCE
protected static com.sun.management.HotSpotDiagnosticMXBean DIAGNOSTIC_INSTANCE
the singleton instance.
-
INSTANTIATED
protected static boolean INSTANTIATED
whether the bean has been instantiated.
-
-
Method Detail
-
initDiagnosticBean
protected static String initDiagnosticBean()
Initializes the diagnostic bean if necessary.- Returns:
- null if successful, otherwise error message
-
-