DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
Automatically generated by Pandoc 2.3.1
jcmd - send diagnostic command requests to a running Java Virtual Machine (JVM)
\f[CB]jcmd\f[R] [\f[I]pid\f[R] | \f[I]main-class\f[R]] \f[I]command\f[R]... | \f[CB]PerfCounter.print\f[R] | \f[CB]-f\f[R] \f[I]filename\f[R]
\f[CB]jcmd\f[R] [\f[CB]-l\f[R]]
\f[CB]jcmd\f[R] \f[CB]-h\f[R]
\f[I]pid\f[R] When used, the \f[CB]jcmd\f[R] utility sends the diagnostic command request to the process ID for the Java process.
\f[I]main-class\f[R] When used, the \f[CB]jcmd\f[R] utility sends the diagnostic command request to all Java processes with the specified name of the main class.
\f[I]command\f[R] The \f[CB]command\f[R] must be a valid \f[CB]jcmd\f[R] command for the selected JVM. The list of available commands for \f[CB]jcmd\f[R] is obtained by running the \f[CB]help\f[R] command (\f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]help\f[R]) where \f[I]pid\f[R] is the process ID for the running Java process. If the \f[I]pid\f[R] is \f[CB]0\f[R], commands will be sent to all Java processes. The main class argument will be used to match, either partially or fully, the class used to start Java. If no options are given, it lists the running Java process identifiers with the main class and command-line arguments that were used to launch the process (the same as using \f[CB]-l\f[R]).
\f[CB]Perfcounter.print\f[R] Prints the performance counters exposed by the specified Java process.
\f[CB]-f\f[R] \f[I]filename\f[R] Reads and executes commands from a specified file, \f[I]filename\f[R].
\f[CB]-l\f[R] Displays the list of Java Virtual Machine process identifiers that are not running in a separate docker process along with the main class and command-line arguments that were used to launch the process. If the JVM is in a docker process, you must use tools such as \f[CB]ps\f[R] to look up the PID.
\f[B]Note:\f[R]
Using \f[CB]jcmd\f[R] without arguments is the same as using \f[CB]jcmd -l\f[R].
\f[CB]-h\f[R] Displays the \f[CB]jcmd\f[R] utility\[aq]s command-line help.
The \f[CB]jcmd\f[R] utility is used to send diagnostic command requests to the JVM. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM. Each diagnostic command has its own set of arguments. To display the description, syntax, and a list of available arguments for a diagnostic command, use the name of the command as the argument. For example:
\f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]help\f[R] \f[I]command\f[R]
If arguments contain spaces, then you must surround them with single or double quotation marks (\f[CB]\[aq]\f[R] or \f[CB]"\f[R]). In addition, you must escape single or double quotation marks with a backslash (\f[CB]\\\f[R]) to prevent the operating system shell from processing quotation marks. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks).
If you specify the process identifier (\f[I]pid\f[R]) or the main class (\f[I]main-class\f[R]) as the first argument, then the \f[CB]jcmd\f[R] utility sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class. You can also send the diagnostic command request to all available Java processes by specifying \f[CB]0\f[R] as the process identifier.
The \f[I]command\f[R] must be a valid \f[CB]jcmd\f[R] diagnostic command for the selected JVM. The list of available commands for \f[CB]jcmd\f[R] is obtained by running the \f[CB]help\f[R] command (\f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]help\f[R]) where \f[I]pid\f[R] is the process ID for a running Java process. If the \f[I]pid\f[R] is \f[CB]0\f[R], commands will be sent to all Java processes. The main class argument will be used to match, either partially or fully, the class used to start Java. If no options are given, it lists the running Java process identifiers that are not in separate docker processes along with the main class and command-line arguments that were used to launch the process (the same as using \f[CB]-l\f[R]).
The following commands are available:
\f[CB]help\f[R] [\f[I]options\f[R]] [\f[I]arguments\f[R]] For more information about a specific command.
\f[I]arguments\f[R]:
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]Compiler.codecache\f[R] Prints code cache layout and bounds.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]Compiler.codelist\f[R] Prints all compiled methods in code cache that are alive.
Impact: Medium
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]Compiler.queue\f[R] Prints methods queued for compilation.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]Compiler.directives_add *filename* *arguments*\f[R] Adds compiler directives from a file.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[I]arguments\f[R]:
\f[I]filename\f[R]: The name of the directives file (STRING, no default value)
\f[CB]Compiler.directives_clear\f[R] Remove all compiler directives.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]Compiler.directives_print\f[R] Prints all active compiler directives.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]Compiler.directives_remove\f[R] Remove latest added compiler directive.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]GC.class_histogram\f[R] [\f[I]options\f[R]] Provides statistics about the Java heap usage.
Impact: High --- depends on Java heap size and content.
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]GC.finalizer_info\f[R] Provides information about the Java finalization queue.
Impact: Medium
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]GC.heap_dump\f[R] [\f[I]options\f[R]] [\f[I]arguments\f[R]] Generates a HPROF format dump of the Java heap.
Impact: High --- depends on the Java heap size and content. Request a full GC unless the \f[CB]-all\f[R] option is specified.
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[I]arguments\f[R]:
\f[CB]GC.heap_info\f[R] Provides generic Java heap information.
Impact: Medium
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]GC.run\f[R] Calls \f[CB]java.lang.System.gc()\f[R].
Impact: Medium --- depends on the Java heap size and content.
\f[CB]GC.run_finalization\f[R] Calls \f[CB]java.lang.System.runFinalization()\f[R].
Impact: Medium --- depends on the Java content.
\f[CB]JFR.check\f[R] [\f[I]options\f[R]] Show information about a running flight recording
Impact: Low
\f[B]Note:\f[R]
The \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax. If no parameters are entered, information for all active recordings is shown.
\f[I]options\f[R]:
\f[CB]JFR.configure\f[R] [\f[I]options\f[R]] Set the parameters for a flight recording
Impact: Low
\f[B]Note:\f[R]
The \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax. If no parameters are entered, the current settings are displayed.
\f[I]options\f[R]:
\f[CB]JFR.dump\f[R] [\f[I]options\f[R]] Write data to a file while a flight recording is running
Impact: Low
\f[B]Note:\f[R]
The \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax. No options are required. The recording continues to run after the data is written.
\f[I]options\f[R]:
\f[B]Note:\f[R] For both \f[CB]begin\f[R] and \f[CB]end\f[R], the time must be in a format that can be read by java.time.LocalTime::parse(STRING), java.time.LocalDateTime::parse(STRING) or java.time.Instant::parse(STRING). For example, "13:20:15", "2020-03-17T09:00:00" or "2020-03-17T09:00:00Z".
\f[B]Note:\f[R] \f[CB]begin\f[R] and \f[CB]end\f[R] times correspond to the timestamps found within the recorded information in the flight recording data.
Another option is to use a time relative to the current time that is specified by a negative integer followed by "s", "m" or "h". For example, "-12h", "-15m" or "-30s"
\f[CB]JFR.start\f[R] [\f[I]options\f[R]] Start a flight recording
Impact: Low
\f[B]Note:\f[R]
The \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax. If no parameters are entered, then a recording is started with default values.
\f[I]options\f[R]:
Event settings and .jfc options can be specified using the following syntax:
You can specify values for multiple event settings and .jfc options by separating them with a whitespace. In case of a conflict between a parameter and a .jfc option, the parameter will take precedence. The whitespace delimiter can be omitted for timespan values, i.e. 20ms. For more information about the settings syntax, see Javadoc of the jdk.jfr package.
\f[CB]JFR.stop\f[R] [\f[I]options\f[R]] Stop a flight recording
Impact: Low
\f[B]Note:\f[R]
The \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax. If no parameters are entered, then no recording is stopped.
\f[I]options\f[R]:
\f[CB]JVMTI.agent_load\f[R] [\f[I]arguments\f[R]] Loads JVMTI native agent.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(control)\f[R]
\f[I]arguments\f[R]:
\f[CB]JVMTI.data_dump\f[R] Signals the JVM to do a data-dump request for JVMTI.
Impact: High
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]ManagementAgent.start\f[R] [\f[I]options\f[R]] Starts remote management agent.
Impact: Low --- no impact
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]ManagementAgent.start_local\f[R] Starts the local management agent.
Impact: Low --- no impact
\f[CB]ManagementAgent.status\f[R] Print the management agent status.
Impact: Low --- no impact
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]ManagementAgent.stop\f[R] Stops the remote management agent.
Impact: Low --- no impact
\f[CB]Thread.print\f[R] [\f[I]options\f[R]] Prints all threads with stacktraces.
Impact: Medium --- depends on the number of threads.
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]VM.classloader_stats\f[R] Prints statistics about all ClassLoaders.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]VM.class_hierarchy\f[R] [\f[I]options\f[R]] [\f[I]arguments\f[R]] Prints a list of all loaded classes, indented to show the class hierarchy. The name of each class is followed by the ClassLoaderData* of its ClassLoader, or "null" if it is loaded by the bootstrap class loader.
Impact: Medium --- depends on the number of loaded classes.
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[I]arguments\f[R]:
\f[CB]VM.command_line\f[R] Prints the command line used to start this VM instance.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]VM.dynlibs\f[R] Prints the loaded dynamic libraries.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]VM.info\f[R] Prints information about the JVM environment and status.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[CB]VM.log\f[R] [\f[I]options\f[R]] Lists current log configuration, enables/disables/configures a log output, or rotates all logs.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(control)\f[R]
\f[I]options\f[R]:
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[CB]VM.flags\f[R] [\f[I]options\f[R]] Prints the VM flag options and their current values.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]VM.native_memory\f[R] [\f[I]options\f[R]] Prints native memory usage
Impact: Medium
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]VM.print_touched_methods\f[R] Prints all methods that have ever been touched during the lifetime of this JVM.
Impact: Medium --- depends on Java content.
\f[CB]VM.set_flag\f[R] [\f[I]arguments\f[R]] Sets the VM flag option by using the provided value.
Impact: Low
Permission: \f[CB]java.lang.management.ManagementPermission(control)\f[R]
\f[I]arguments\f[R]:
\f[CB]VM.stringtable\f[R] [\f[I]options\f[R]] Dumps the string table.
Impact: Medium --- depends on the Java content.
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]VM.symboltable\f[R] [\f[I]options\f[R]] Dumps the symbol table.
Impact: Medium --- depends on the Java content.
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax).
\f[I]options\f[R]:
\f[CB]VM.systemdictionary\f[R] Prints the statistics for dictionary hashtable sizes and bucket length.
Impact: Medium
Permission: \f[CB]java.lang.management.ManagementPermission(monitor)\f[R]
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]VM.system_properties\f[R] Prints the system properties.
Impact: Low
Permission: \f[CB]java.util.PropertyPermission(*, read)\f[R]
\f[CB]VM.uptime\f[R] [\f[I]options\f[R]] Prints the VM uptime.
Impact: Low
\f[B]Note:\f[R]
The following \f[I]options\f[R] must be specified using either \f[I]key\f[R] or \f[I]key\f[R]\f[CB]=\f[R]\f[I]value\f[R] syntax.
\f[I]options\f[R]:
\f[CB]VM.version\f[R] Prints JVM version information.
Impact: Low
Permission: \f[CB]java.util.PropertyPermission(java.vm.version, read)\f[R]