The diagnostic MBean is registered to the platform MBeanServer as are other platform MBeans.
The ObjectName for uniquely identifying the diagnostic
MXBean within an MBeanServer is:
com.sun.management:type=HotSpotDiagnostic
It can be obtained by calling the
PlatformManagedObject#getObjectName method.
All methods throw a NullPointerException if any input argument is
null unless it's stated otherwise.
java.lang.management.ManagementFactory#getPlatformMXBeans(Class)
| Modifier and Type | Class and Description |
|---|---|
| public static enum | HotSpotDiagnosticMXBean.
Thread dump format. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public default void | dumpThreads(String
the path to the file to create outputFile, HotSpotDiagnosticMXBean.the format to use formatGenerate a thread dump to the given file in the given format. |
| public List | Returns: a list ofVMOption objects for all diagnostic options.Returns a list of |
| public VMOption | Returns: aVMOption object for a VM option of the given name.Returns a |
| public void | setVMOption(String
Name of a VM option name, String New value of the VM option to be set value)Sets a VM option of the given name to the specified value. |
| dumpHeap | back to summary |
|---|---|
| public void dumpHeap(String outputFile, boolean live) throws IOException Dumps the heap to the
If this method is called remotely from another process,
the heap dump output is written to a file named
| |
| dumpThreads | back to summary |
|---|---|
| public default void dumpThreads(String outputFile, HotSpotDiagnosticMXBean. Generate a thread dump to the given file in the given format. The
When the format is specified as The thread dump will include output for all platform threads. It may include output for some or all virtual threads. Implementation Specification The default implementation throws API Note The output file is required to be an absolute path as the MXBean may be accessed remotely from a tool or program with a different current working directory.
| |
| getDiagnosticOptions | back to summary |
|---|---|
| public List Returns a list of | |
| getVMOption | back to summary |
|---|---|
| public VMOption getVMOption(String name) Returns a
| |
| setVMOption | back to summary |
|---|---|
| public void setVMOption(String name, String value) Sets a VM option of the given name to the specified value.
The new value will be reflected in a new
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final HotSpotDiagnosticMXBean. | JSON
JSON (JavaScript Object Notation) format. |
| public static final HotSpotDiagnosticMXBean. | TEXT_PLAIN
Plain text format. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static HotSpotDiagnosticMXBean. | |
| public static HotSpotDiagnosticMXBean. |
| JSON | back to summary |
|---|---|
| public static final HotSpotDiagnosticMXBean. JSON (JavaScript Object Notation) format.
| |
| TEXT_PLAIN | back to summary |
|---|---|
| public static final HotSpotDiagnosticMXBean. Plain text format. | |
| ThreadDumpFormat | back to summary |
|---|---|
| private ThreadDumpFormat() | |
| valueOf | back to summary |
|---|---|
| public static HotSpotDiagnosticMXBean. | |
| values | back to summary |
|---|---|
| public static HotSpotDiagnosticMXBean. | |