Interface HotSpotDiagnosticMXBean

  • All Superinterfaces:
    PlatformManagedObject


    public interface HotSpotDiagnosticMXBean
    extends PlatformManagedObject
    Diagnostic management interface for the HotSpot Virtual Machine.

    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.
    See Also:
    ManagementFactory.getPlatformMXBeans(Class)
    • Method Detail

      • dumpHeap

        void dumpHeap​(String outputFile,
                      boolean live)
               throws IOException
        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 - if the outputFile already exists, cannot be created, opened, or written to.
        UnsupportedOperationException - if this operation is not supported.
        IllegalArgumentException - if outputFile does not end with ".hprof" suffix.
        NullPointerException - if outputFile is null.
        SecurityException - If a security manager exists and its SecurityManager.checkWrite(java.lang.String) method denies write access to the named file or the caller does not have ManagmentPermission("control").
      • getDiagnosticOptions

        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.
      • getVMOption

        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.
        Throws:
        NullPointerException - if name is null.
        IllegalArgumentException - if a VM option of the given name does not exist.