java.lang.Object
openj9.lang.management.internal.OpenJ9DiagnosticsMXBeanImpl
- All Implemented Interfaces:
PlatformManagedObject
,OpenJ9DiagnosticsMXBean
Runtime type for
OpenJ9DiagnosticsMXBean
.
Implements functionality to dynamically configure dump options and to trigger supported dump agents.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OpenJ9DiagnosticsMXBean
Singleton accessor method.Returns the object name of the MXBean.String[]
Returns the current dump configuration as an array of Strings, or null if an internal error occurs.void
Reset the JVM dump options to the settings specified when the JVM was started removing any additional configuration done since then.void
setDumpOptions
(String dumpOptions) This function sets options for the dump subsystem.This function triggers the heap dump agent and requests for a heap dump in CLASSIC format.void
triggerDump
(String dumpAgent) This function triggers the specified dump agent.triggerDumpToFile
(String dumpAgent, String fileNamePattern) This function triggers the specified dump agent.
-
Method Details
-
resetDumpOptions
Reset the JVM dump options to the settings specified when the JVM was started removing any additional configuration done since then. This method may throw a ConfigurationUnavailableException if the dump configuration cannot be altered. If this occurs it will usually be because a dump event is currently being handled.- Specified by:
resetDumpOptions
in interfaceOpenJ9DiagnosticsMXBean
- Throws:
ConfigurationUnavailableException
- if the configuration cannot be changed because a dump is already in progress
-
queryDumpOptions
Returns the current dump configuration as an array of Strings, or null if an internal error occurs. The syntax of the option Strings is the same as the -Xdump command-line option, with the initial -Xdump: omitted. See the -Xdump option section on dump agents in the documentation for the OpenJ9 JVM.- Specified by:
queryDumpOptions
in interfaceOpenJ9DiagnosticsMXBean
-
setDumpOptions
public void setDumpOptions(String dumpOptions) throws InvalidOptionException, ConfigurationUnavailableException This function sets options for the dump subsystem. The dump option is passed in as a String. Use the same syntax as the -Xdump command-line option, with the initial -Xdump: omitted. See the -Xdump option section on dump agents in the documentation for the OpenJ9 JVM. This method may throw a ConfigurationUnavailableException if the dump configuration cannot be altered.- Specified by:
setDumpOptions
in interfaceOpenJ9DiagnosticsMXBean
- Parameters:
dumpOptions
- the options string to be set- Throws:
InvalidOptionException
- if the specified dumpOptions cannot be set or is incorrectConfigurationUnavailableException
- if the configuration cannot be changed because a dump is already in progress
-
triggerDump
This function triggers the specified dump agent. Dump agents supported - java, snap, system and heap. A java dump is in a human-readable format, and summarizes the state of the JVM. The default heap dump format (a phd file) is not human-readable. A system dump is a platform-specific file that contains information about the active processes, threads, and system memory. System dumps are usually large. The snap dump format is not human-readable and must be processed using the trace formatting tool supplied with the OpenJ9 JVM.- Specified by:
triggerDump
in interfaceOpenJ9DiagnosticsMXBean
- Parameters:
dumpAgent
- the dump agent to be triggered- Throws:
IllegalArgumentException
- if the specified dump agent is invalid or unsupported by this method
-
triggerDumpToFile
public String triggerDumpToFile(String dumpAgent, String fileNamePattern) throws IllegalArgumentException, InvalidOptionException This function triggers the specified dump agent. Dump agents supported - java, snap, system and heap. The JVM will attempt to write the file to the specified file name. This may include replacement tokens as documented in the section on dump agents in the documentation for the OpenJ9 JVM. A string containing the actual filename written to is returned. This may not be the same as the requested filename for several reasons:- null or the empty string was specified, this will cause the JVM to write the dump to the default location based on the current dump settings and return that path.
- Replacement (%) tokens were specified in the file name. These will have been expanded.
- The full path is returned, if only a filename with no directory was specified the full path with the directory the dump was written to will be returned.
- The JVM couldn't write to the specified location. In this case it will attempt to write the dump to another location, unless -Xdump:nofailover was specified on the command line.
- Specified by:
triggerDumpToFile
in interfaceOpenJ9DiagnosticsMXBean
- Parameters:
dumpAgent
- the dump agent to be triggeredfileNamePattern
- the filename to write to, which may be null, empty or include replacement tokens- Returns:
- the file name that the dump was actually written to
- Throws:
IllegalArgumentException
- if the specified dump agent is invalid or unsupported by this methodInvalidOptionException
- if the fileNamePattern was invalid
-
triggerClassicHeapDump
This function triggers the heap dump agent and requests for a heap dump in CLASSIC format.- Specified by:
triggerClassicHeapDump
in interfaceOpenJ9DiagnosticsMXBean
- Returns:
- The file name of the dump that was created
- Throws:
InvalidOptionException
- if the dump operation fails
-
getInstance
Singleton accessor method. Returns an instance ofOpenJ9DiagnosticsMXBeanImpl
.- Returns:
- a static instance of
OpenJ9DiagnosticsMXBeanImpl
.
-
getObjectName
Returns the object name of the MXBean.- Specified by:
getObjectName
in interfacePlatformManagedObject
- Returns:
- objectName representing the MXBean.
-