public class

HotSpotDiagnostic

extends Object
implements HotSpotDiagnosticMXBean
java.lang.Object
   ↳ sun.management.HotSpotDiagnostic

Class Overview

Implementation of the diagnostic MBean for Hotspot VM.

Summary

Public Constructors
HotSpotDiagnostic()
Public Methods
void dumpHeap(String outputFile, boolean live)
Dumps the heap to the outputFile file in the same format as the hprof heap dump.
List<VMOption> getDiagnosticOptions()
Returns a list of VMOption objects for all diagnostic options.
VMOption getVMOption(String name)
Returns a VMOption object for a VM option of the given name.
void setVMOption(String name, String value)
Sets a VM option of the given name to the specified value.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.sun.management.HotSpotDiagnosticMXBean

Public Constructors

public HotSpotDiagnostic ()

Public Methods

public void dumpHeap (String outputFile, boolean live)

Dumps the heap to the outputFile file in the same format as the hprof heap dump.

If this method is called remotely from another process, the heap dump output is written to a file named outputFile on the machine where the target VM is running. If outputFile is a relative path, it is relative to the working directory where the target VM was started.

Parameters
outputFile the system-dependent filename
live if true dump only live objects i.e. objects that are reachable from others
Throws
IOException

public List<VMOption> getDiagnosticOptions ()

Returns a list of VMOption objects for all diagnostic options. A diagnostic option is a writeable VM option that can be set dynamically mainly for troubleshooting and diagnosis.

Returns
  • a list of VMOption objects for all diagnostic options.

public VMOption getVMOption (String name)

Returns a VMOption object for a VM option of the given name.

Returns
  • a VMOption object for a VM option of the given name.

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 VMOption object returned by the getVMOption(String) method or the getDiagnosticOptions() method. This method does not change the value of this VMOption object.

Parameters
name Name of a VM option
value New value of the VM option to be set