Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java
38831 views
/*1* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.management;2627import java.lang.management.PlatformManagedObject;2829/**30* Diagnostic management interface for the HotSpot Virtual Machine.31*32* <p>The diagnostic MBean is registered to the platform MBeanServer33* as are other platform MBeans.34*35* <p>The <tt>ObjectName</tt> for uniquely identifying the diagnostic36* MXBean within an MBeanServer is:37* <blockquote>38* <tt>com.sun.management:type=HotSpotDiagnostic</tt>39* </blockquote>40.*41* It can be obtained by calling the42* {@link PlatformManagedObject#getObjectName} method.43*44* All methods throw a {@code NullPointerException} if any input argument is45* {@code null} unless it's stated otherwise.46*47* @see ManagementFactory#getPlatformMXBeans(Class)48*/49@jdk.Exported50public interface HotSpotDiagnosticMXBean extends PlatformManagedObject {51/**52* Dumps the heap to the <tt>outputFile</tt> file in the same53* format as the hprof heap dump.54* <p>55* If this method is called remotely from another process,56* the heap dump output is written to a file named <tt>outputFile</tt>57* on the machine where the target VM is running. If outputFile is58* a relative path, it is relative to the working directory where59* the target VM was started.60*61* @param outputFile the system-dependent filename62* @param live if <tt>true</tt> dump only <i>live</i> objects63* i.e. objects that are reachable from others64* @throws IOException if the <tt>outputFile</tt> already exists,65* cannot be created, opened, or written to.66* @throws UnsupportedOperationException if this operation is not supported.67* @throws IllegalArgumentException if <tt>outputFile</tt> does not end with ".hprof" suffix.68* @throws NullPointerException if <tt>outputFile</tt> is <tt>null</tt>.69* @throws SecurityException70* If a security manager exists and its {@link71* java.lang.SecurityManager#checkWrite(java.lang.String)}72* method denies write access to the named file73* or the caller does not have ManagmentPermission("control").74*/75public void dumpHeap(String outputFile, boolean live) throws java.io.IOException;7677/**78* Returns a list of <tt>VMOption</tt> objects for all diagnostic options.79* A diagnostic option is a {@link VMOption#isWriteable writeable}80* VM option that can be set dynamically mainly for troubleshooting81* and diagnosis.82*83* @return a list of <tt>VMOption</tt> objects for all diagnostic options.84*/85public java.util.List<VMOption> getDiagnosticOptions();8687/**88* Returns a <tt>VMOption</tt> object for a VM option of the given89* name.90*91* @return a <tt>VMOption</tt> object for a VM option of the given name.92* @throws NullPointerException if name is <tt>null</tt>.93* @throws IllegalArgumentException if a VM option of the given name94* does not exist.95*/96public VMOption getVMOption(String name);9798/**99* Sets a VM option of the given name to the specified value.100* The new value will be reflected in a new <tt>VMOption</tt>101* object returned by the {@link #getVMOption} method or102* the {@link #getDiagnosticOptions} method. This method does103* not change the value of this <tt>VMOption</tt> object.104*105* @param name Name of a VM option106* @param value New value of the VM option to be set107*108* @throws IllegalArgumentException if the VM option of the given name109* does not exist.110* @throws IllegalArgumentException if the new value is invalid.111* @throws IllegalArgumentException if the VM option is not writable.112* @throws NullPointerException if name or value is <tt>null</tt>.113*114* @throws java.lang.SecurityException115* if a security manager exists and the caller does not have116* ManagementPermission("control").117*/118public void setVMOption(String name, String value);119}120121122