5 Diagnostic Commands

This chapter is an alphabetically ordered reference for all the diagnostic commands that you can send to a running Oracle JRockit JVM process.

For more information about sending diagnostic commands to a JVM process, see "Running Diagnostic Commands" in Oracle JRockit JDK Tools Guide.

This chapter describes the following diagnostic commands and their attributes:

5.1 check_flightrecording

This command is associated with Oracle JRockit Flight Recorder. It prints information about the status of Flight Recording. This command accepts the following arguments:

Argument Description
name The recording identifier as a string. If you use this parameter, you do not have to specify a value for recording.
recording The recording identifier as a number. If you use this parameter, you do not have to specify a value for name.
verbose Specifies whether or not to enable verbose output.

The default value is false.


5.2 command_line

This command prints the command-line options used to start the JRockit JVM.

5.3 dump_flightrecording

This command is associated with Oracle JRockit Flight Recorder. It dumps the running Flight Recorder recordings. This command accepts the following arguments:

Argument Description
name The recording identifier as a string. If you use this parameter, you do not have to specify a value for recording.
recording The recording identifier as a number. If you use this parameter, you do not have to specify a value for name.
copy_to_file Specify the name of the file to which you want the recording data to be copied.
compress_copy Compress the file at the copy_to_file location using GZip. The default value is false.

5.4 exception_trace_filter

This command filters exception logging and JRockit Flight Recorder exception events based on the exception type specified. This command accepts the following argument:

Argument Description
pattern Specify the exception type as a string. For example:

jrcmd <pid> exception_trace_filter pattern=java.lang.Exception


5.5 force_crash

Forces the Oracle JRockit JVM to execute code that will make the process fail and create a core file.

This command is not enabled by default because of the serious implications of using it. Use this command only for diagnosing problems that require getting the full state of the JVM. To be able to run the command, start JRockit with -Djrockit.ctrlbreak.enableforce_crash=true.

5.6 fork_and_abort

This command causes JRockit to fork a child process that will immediately abort. If the environment has been properly configured to generate a core file when a process crashes, a core file will be created. This command is intended for generating a core file when tools such as gdb or gcore cannot be used. Since the core file generated using this command will not include context information for each thread, generating a core file using gdb or gcore is always preferred when possible.

Note:

This command is available since R28.3.9. This command is not available on Windows environments.

5.7 heap_diagnostics

This command causes a heap diagnostic report to be printed (also, see -XX:HeapDiagnosticsOnOutOfMemoryError in the Oracle JRockit Command Line Reference). This command sends output to the Ctrl-Break Handler output stream and not to the path specified by the -XX:HeapDiagnosticsPath option.

5.8 help

This command displays additional information about a specific command or all commands. This command accepts the following arguments:

Argument Description
all Shows help for all commands. The default is false; this argument is optional.
command Shows help for the specified command. This argument is optional. If you omit it, the command will show a list of available commands.

5.9 hprofdump

This command generates an HPROF format dump of the Java heap.

Format:

hprofdump [filename=<file>] [segment_threshold] [segment_size]

This command accepts the following arguments:

Argument Description
filename Sets the name of the file to which the dump should be written. If you do not specify a filename, the command will use the value specified with the -XX:HeapDumpPath command-line option.
segment_threshold Sets the amount of heap usage above which the JVM should generate a segmented heap dump (JAVA PROFILE 1.0.2 format). If you do not specify a segment threshold, the command will use the default value of -XX:SegmentedHeapDumpThreshold, as described in the Oracle JRockit Command-Line Reference.
segment_size Sets the approximate segment size to which a generated segmented heap dump should be limited. If you do not specify segment_size, this command uses the default value set for -XX:HeapDumpSegmentSize, as described in the Oracle JRockit Command-Line Reference.

5.10 kill_management_server

This command stops the management server by shutting down the listening socket. The managementserver.jar has to be in the boot classpath for this command to work.

5.11 list_vmflags

This command lists the flag options in the Oracle JRockit JVM and their current values:

  • flag: Lists only this flag.

  • describe: Shows the description for flags.

  • alias: Prints the flag alias if one is available.

  • setonly: Lists only flags that are explicitly or implicitly set.

5.12 lockprofile_print

This command prints the current values of the lock profile counters. You can enable lock profiling by using the -XX+UseLockProfiling option.

5.13 lockprofile_reset

This command resets the current values of the lock profile counters. You can enable lock profiling by using the -XX+UseLockProfiling option.

5.14 memleakserver

This command starts or shuts down the memory leak server. This command accepts the following arguments:

Argument Description
port Identifies the port to which to bind. The default value is 7095.
version Identifies the required protocol version. The default value is 3.
action Starts or stops the server. The default is to toggle state.
force Forces an action. The default value is false.

5.15 print_class_summary

This command prints all loaded classes.

5.16 print_exceptions

This command enables or disables the printing of exceptions (see -Xverbose in the Oracle JRockit Command-Line Reference).

Format:

print_exceptions stacktraces= all|true|false][exceptions= all|true|false]

Note:

To turn exception printing off completely, set exceptions=false even if it was turned on by stacktraces=true.

5.17 print_memusage

This command prints all memory used by the JRockit JVM process, per OS data, plus any memory usage perceived by each subsystem.

To get the most detailed information out of this command, set USE_OS_MALLOC to 0 in your environment variables. Also, if you enable the variable TRACE_ALLOC_SITES (that is, set it to 1) to enable allocation site tracking by default, you might add some overhead, but you will also receive information about the location of every allocation.

Format:

print_memusage [baseline] [test] [level=<1 | 2 | 3>] [reset] [displayMap]

Use print_memusage with any of the following arguments:

Argument Description
baseline Stores a snapshot of the memory usage.
test Prints the difference between this stored baseline and the previously stored baseline.
level Specifies the level of detail to be printed. Level 1 gives memory usage for the source files; level 2 gives more detail, providing memory usage for the function name; level 3 provides the most detail, providing memory usage statistics at the source code level.
reset Prints the memory usage statistics and removes the stored baseline. Further print_memusage results will not show any difference until a new baseline is set.
displayMap Sets the memory usage baseline on the virtual memory.

5.18 print_object_summary

See the Memory Leak Detector online help that ships with Oracle JRockit Mission Control.

5.19 print_threads

Prints a normal thread dump.

Format:

print_threads [nativestack= true] [jvmmonitors=true]

This command accepts these arguments:

Argument Description
compact Prints all threads with the same stacktrace together (will not print nativestack or monitors). The default value is false.
concurrentlocks Prints java.util.concurrent locks. The default value is false.
internal Prints Oracle JRockit internal threads. The default value is true.
javastack Prints Java stack frames. The default value is false.
jvmmonitors: true Prints the JRockit JVM's internal native locks (those that are registered): status and wait queue, and, with XX:+UseNativeLockProfiling, their profile statistics (acquired/contended/tryfailed).
monitors Prints lock information. The default value is true.
nativestack: true Includes native frames in the stack trace. The default value is false.

5.20 print_utf8pool

This command prints all UTF8 strings.

5.21 print_vm_state

This command prints information about the internal state of the JVM. This information can be used for troubleshooting by Oracle support and is the same information that is included in Oracle JRockit failure reports.

5.22 runsystemgc

This command calls the java.lang.System.gc() method and runs the garbage collector.

Format:

runsystemgc [full=false] [fullcompact=true]

The command accepts these arguments:

Argument Description
full Does a full garbage collection.

It inherits the system default value (see -XXfullSystemGC).

fullcompact Forces full compaction for each full garbage collection event. The default value is true.

5.23 set_filename

This command sets the file that all commands following this command will use for printing. You can have several set_filename commands in a file. By default, for SIGQUIT or ctrl+break invocations, the commands print to the stderr output stream of the JVM. For jrcmd invocations, the print goes to the stdout output stream of the jrcmd process by default. The append argument defaults to overwrite.

Format:

set_filename [filename=<file>] [append=true]
Argument Description
filename (Optional) Specifies the name of the file for printing. If not specified, JVM will reset to the default behavior.
append (Optional) Specifies whether you want to append to the file or overwrite it.

5.24 start_flightrecording

Starts a flight recording. This command accepts the following arguments:

Argument Description
compress: true Directs the Flight Recorder to gzip the .jfr file on the disk.The default value is false.
defaultrecording: true Enables a default recording. The default value is false.
delay Sets the amount of time to elapse during run time before starting the recording.
duration Sets the amount of time for the recording to run.
filename Sets the name of the flight recording log file. This file will have the extension .jfr.
maxage For time-bound recordings, sets the maximum amount of time a recording can last before that recording is flushed from the thread buffer to the global buffer.
maxsize For size-bound recordings, sets the maximum size of a recording before that recording is flushed from the thread buffer to the global buffer.
name Sets a recording identifier.
settings Identifies the event settings file to use for the recording.

5.25 start_management_server

This command starts the management server by starting the listening socket that, in turn, starts servers whenever a connection is established. This command accepts these arguments:

Argument Description
none Enables the JMX local monitoring through a JMX connector published on a private interface used by local JMX clients that use the Attach API.
autodiscovery Enables or disables autodiscovery for the remote JMX connector, which enables Oracle JRockit Mission Control to automatically discover running JRockit JVM instances through the multicast-based JRockit Discovery Protocol (JDP).
autodiscovery_name Enables you to specify the path and name of the cluster and node from where Oracle JRockit Mission Control discover information about various JRockit JVM instances running in a network.
authenticate Enables or disables authentication. When this property is set to false, JMX does not use passwords or access files. All users are allowed all access.
class Loads the class and causes its empty constructor to be called early in the JVM startup. From the constructor, a new thread is then started, from which your management client is run. Further arguments cannot be given to -Xmanagement after the class argument.
config_file Specifies the location of the file from which additional management configuration properties are loaded.
interface Specifies the local address (on the management server side) on which to listen for connections. This applies to machines with several addresses (network cards).
local Enables or disables the local JMX connector.
port Identifies the port that the management server opens for remote access.
registry_ssl Binds the RMI connector stub to an RMI registry protected by SSL.
remote Enables or disables the remote JMX connector.
rmiserver_port Binds the RMI server to the specified port.
ssl Enables or disables SSL encryption.

This command serves the same purpose as the -Xmanagement command-line option. For more information, see the entry for -Xmanagement in the Oracle JRockit Command Line Reference.

5.26 stop_flightrecording

This command stops an in-process flight recording. This command accepts the following arguments:

Format:

stop_flightrecording [name=<string>][recording=<s8>] [discard=<true | false>] [copy_to_file=<string>] [compress_copy=<true | false>]
Argument Description
name Recording identifier as a string.
recording Recording identifier as a number.
discard Discards the recording; the default is false.
copy_to_file Transfers the recording to a .jfr file.
compress_copy Gzip the .jfr file on disk.

5.27 stop_management_server

This command stops the management server.

5.28 timestamp

This command prints a timestamp, including the uptime of the queried JVM..

5.29 verbosity

This command changes the verbosity level usually specified with -Xverbose.

Format:

verbosity [args=<components>] [filename=<file>]

5.30 version

This command prints the JRockit JVM version.