JCMD(1)

๐Ÿ“ฆ
version 27.0.0.0.35 ยท 37 versions
, in epel 10, epel 9

๐ŸŽ€ JCMD(1) โ€” JDK Commands ๐ŸŽ€

part 1 of 4, bestie โ€” this is the jcmd manual page and we're doing it with full main-character energy โœจ


โœจ NAME โœจ

jcmd โ€” send diagnostic command requests to a running Java Virtual Machine (JVM). That's it, that's the vibe. ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

jcmd [pid | main-class] command...  | PerfCounter.print | -f filename

jcmd [-l]

jcmd -h

Here's what those little guys mean:

  • pid โ€” when used, the jcmd utility sends the diagnostic command request to the process ID for the Java process. ๐Ÿซถ
  • main-class โ€” when used, the jcmd utility sends the diagnostic command request to all Java processes with the specified name of the main class. Yes, all of them, periodt.
  • command โ€” must be a valid jcmd command for the selected JVM. The list of available commands for jcmd is obtained by running the help command (jcmd pid help), where pid is the process ID for the running Java process. It's giving "ask the JVM for the menu." ๐Ÿ“‹
  • Perfcounter.print โ€” prints the performance counters exposed by the specified Java process. (The synopsis line spells it PerfCounter.print with a capital C; that's literally what the page says. ๐Ÿ’…)
  • -f filename โ€” reads and executes commands from a specified file, filename. ๐Ÿ“
  • -l โ€” 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 ps to look up the PID. Lowkey important: using jcmd without arguments is the same as using jcmd -l. ๐Ÿณ
  • -h โ€” displays the jcmd utility's command-line help. Your little rescue button. ๐Ÿ’–

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Okay so jcmd 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 it must have the same effective user and group identifiers that were used to launch the JVM. No cap, that's the rule. ๐Ÿ”’

Each diagnostic command has its own set of options and arguments. To display the description, syntax, and a list of available options and arguments for a diagnostic command, use the name of the command as the argument. For example:

jcmd pid help command

If arguments contain spaces, then you must surround them with single or double quotation marks (' or "). In addition, you must escape single or double quotation marks with a backslash (\) 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). Quoting drama, but make it safe. ๐Ÿ’…

If you specify the process identifier (pid) or the main class (main-class) as the first argument, then the jcmd 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 0 as the process identifier. Zero means "everybody," bestie. 0๏ธโƒฃ


๐Ÿ’œ COMMANDS FOR JCMD ๐Ÿ’œ

The command must be a valid jcmd diagnostic command for the selected JVM. The list of available commands for jcmd is obtained by running the help command (jcmd pid help), where pid is the process ID for a running Java process. If the pid is 0, 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 -l). ๐Ÿซถ

jcmd commands may take options and arguments. Options are specified using either key or key=value syntax. Arguments are given as just a value, never name=value. Write that down. ๐Ÿ“

The following commands are available:

help [options] [arguments]

For more information about a specific command.

arguments:

  • command name โ€” the name of the command for which we want help (STRING, no default value). ๐Ÿ‘‘
Note: the following options must be specified using either key or key=value syntax.

options:

  • -all โ€” (Optional) Show help for all commands (BOOLEAN, false). All the help, all at once. โœจ

AOT.end_recording

Ends an in-progress AOT training and records the results to the file(s) specified by -XX:AOTConfiguration and/or -XX:AOTCacheOutput. ๐Ÿ”ฅ

Impact: Low

Note: the JVM must be started in AOT training mode using command-line arguments such as -XX:AOTMode=record or -XX:AOTCacheOutput=<file>. The results of the AOT training can be an AOT configuration file, an AOT cache file, or both. ๐Ÿงš

Compiler.CodeHeap_Analytics [function] [granularity]

Print CodeHeap analytics.

Impact: Low: Depends on code heap size and content. Holds CodeCache_lock during analysis step, usually sub-second duration.

arguments:

  • function โ€” (Optional) Function to be performed (aggregate, UsedSpace, FreeSpace, MethodCount, MethodSpace, MethodAge, MethodNames, discard) (STRING, all). Pick your fighter. ๐Ÿ’…
  • granularity โ€” (Optional) Detail level - smaller value -> more detail (INT, 4096). Small number = big detail energy. ๐Ÿ”

Compiler.codecache

Prints code cache layout and bounds.

Impact: Low


Compiler.codelist

Prints all compiled methods in code cache that are alive.

Impact: Medium


Compiler.directives_add arguments

Adds compiler directives from a file.

Impact: Low

arguments:

  • filename โ€” the name of the directives file (STRING, no default value). ๐Ÿ“

Compiler.directives_clear

Remove all compiler directives.

Impact: Low


Compiler.directives_print

Prints all active compiler directives.

Impact: Low


Compiler.directives_remove

Remove latest added compiler directive.

Impact: Low


Compiler.memory [options]

Print compilation footprint.

Impact: Medium: Pause time depends on number of compiled methods

Note: the options must be specified using either key or key=value syntax.

options:

  • -H โ€” (Optional) Human readable format (BOOLEAN, false). H for human, H for hello bestie. ๐Ÿ‘‹
  • -s โ€” (Optional) Minimum memory size (MEMORY SIZE, 0). ๐Ÿง 

Compiler.perfmap [arguments] (Linux only)

Write map file for Linux perf tool.

Impact: Low

arguments:

  • filename โ€” (Optional) The name of the map file. If %p is specified in the filename, it is expanded to the JVM's PID. (FILE, "/tmp/perf-%p.map"). Linux only, bestie. ๐Ÿง

Compiler.queue

Prints methods queued for compilation.

Impact: Low


GC.class_histogram [options]

Provides statistics about the Java heap usage.

Impact: High --- depends on Java heap size and content. High impact, so hydrate before you run it. ๐Ÿ’ง

Note: the options must be specified using either key or key=value syntax.

options:

  • -all โ€” (Optional) Inspects all objects, including unreachable objects (BOOLEAN, false). Yes, even the unreachable ones. ๐Ÿ™ˆ
  • -parallel โ€” (Optional) Number of parallel threads to use for heap inspection. 0 (the default) means let the VM determine the number of threads to use. 1 means use one thread (disable parallelism). For any other value the VM will try to use the specified number of threads, but might use fewer. (INT, 0). Thread math, but make it cute. ๐Ÿงต

GC.finalizer_info

Provides information about the Java finalization queue.

Impact: Medium


GC.heap_dump [options] filename

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 -all option is specified. High impact, full GC unless -all, you've been warned. ๐Ÿšจ

Note: the following options must be specified using either key or key=value syntax.

options:

  • -all โ€” (Optional) Dump all objects, including unreachable objects (BOOLEAN, false). ๐Ÿซถ
  • -gz โ€” (Optional) If specified, the heap dump is written in gzipped format using the given compression level. 1 (recommended) is the fastest, 9 the strongest compression. (INT, 1). Compression glow-up. ๐Ÿ—œ๏ธ
  • -overwrite โ€” (Optional) If specified, the dump file will be overwritten if it exists (BOOLEAN, false). Overwrite? Only if you mean it. ๐Ÿ’…
  • -parallel โ€” (Optional) Number of parallel threads to use for heap dump. The VM will try to use the specified number of threads, but might use fewer. (INT, 1). ๐Ÿงต

arguments:

  • filename โ€” the name of the dump file. If %p is specified in the filename, it is expanded to the JVM's PID. (FILE, no default value). ๐Ÿ“

GC.heap_info

Provides generic Java heap information.

Impact: Medium


GC.run

Calls java.lang.System.gc().

Impact: Medium --- depends on the Java heap size and content.


GC.run_finalization

Calls java.lang.System.runFinalization().

Impact: Medium --- depends on the Java content.


JFR.check [options]

Show information about a running flight recording.

Impact: Low

Note: the options must be specified using either key or key=value syntax. If no parameters are entered, information for all active recordings is shown.

options:

  • name โ€” (Optional) Name of the flight recording. (STRING, no default value). โœˆ๏ธ
  • verbose โ€” (Optional) Flag for printing the event settings for the recording (BOOLEAN, false). Spill the tea, verbose. โ˜•

JFR.configure [options]

Set the parameters for a flight recording.

Impact: Low

Note: the options must be specified using either key or key=value syntax. If no parameters are entered, the current settings are displayed.

options:

  • dumppath โ€” (Optional) Path to the location where a recording file is written in case the VM runs into a critical error, such as a system crash. (STRING, The default location is the current directory). ๐Ÿ—‚๏ธ
  • globalbuffercount โ€” (Optional) Number of global buffers. This option is a legacy option: change the memorysize parameter to alter the number of global buffers. This value cannot be changed once JFR has been initialized. (STRING, default determined by the value for memorysize). Legacy icon, cannot change once JFR is initialized. ๐Ÿ‘‘
  • globalbuffersize โ€” (optional) the size of the global buffers, in bytes. Okay so heads up: this is a legacy option, so if you actually want to change the size of the global buffers, go change the memorysize parameter instead. And once JFR has been initialized, this value is locked in forever, no takebacks. (STRING, default determined by the value for memorysize)
  • maxchunksize โ€” (optional) the maximum size of an individual data chunk in bytes, unless you use one of these suffixes: 'm' or 'M' for megabytes OR 'g' or 'G' for gigabytes. Also cannot be changed once JFR has been initialized, periodt. (STRING, 12M)
  • memorysize โ€” (optional) the overall memory size, in bytes if you don't use one of these suffixes: 'm' or 'M' for megabytes OR 'g' or 'G' for gigabytes. Again: cannot be changed once JFR has been initialized. (STRING, 10M)
  • repositorypath โ€” (optional) the path to the location where recordings are stored until they get written to a permanent file. (STRING, the default location is the temporary directory for the operating system. On Linux operating systems, the temporary directory is /tmp. On Windows, the temporary directory is specified by the TMP environment variable.)
  • preserve-repository={true|false} โ€” specifies whether files stored in the disk repository should be kept after the JVM has exited. If false, files are deleted. By default, this parameter is disabled. ๐Ÿ—‘๏ธ
  • stackdepth โ€” (optional) the stack depth for stack traces. Setting this value greater than the default of 64 may cause a performance degradation, so likeโ€ฆ be careful bestie. This value cannot be changed once JFR has been initialized. (LONG, 64)
  • thread_buffer_size โ€” (optional) the local buffer size for each thread, in bytes, if one of the following suffixes is not used: 'k' or 'K' for kilobytes or 'm' or 'M' for megabytes. Overriding this parameter could reduce performance and is not recommended โ€” highkey leave it alone. This value cannot be changed once JFR has been initialized. (STRING, 8k)
  • samplethreads โ€” (optional) the flag for activating thread sampling. (BOOLEAN, true)

โœจ JFR.dump [options] โœจ

Write data to a file while a flight recording is running.

Impact: Low

Note ๐Ÿ’–

The options must be specified using either key or key=value syntax. No options are required (chill, it works with nothing). The recording continues to run after the data is written โ€” it does not stop, iykyk.

options:

  • begin โ€” (optional) specify the time from which recording data will be included in the dump file. The format is specified as local time. (STRING, no default value)
  • end โ€” (optional) specify the time to which recording data will be included in the dump file. The format is specified as local time. (STRING, no default value)
Note: for both begin and end, 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".
Note: begin and end 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" โฐ

  • filename โ€” (optional) the name of the file to which the flight recording data is dumped. If no filename is given, a filename is generated from the PID and the current date. The filename may also be a directory, in which case the filename is generated from the PID and the current date in the specified directory. If %p and/or %t is specified in the filename, it expands to the JVM's PID and the current timestamp, respectively. (FILE, no default value) ๐ŸŽ€
  • maxage โ€” (optional) the length of time for dumping the flight recording data to a file. (INTEGER followed by 's' for seconds, 'm' for minutes or 'h' for hours, no default value)
  • maxsize โ€” (optional) the maximum size for the amount of data to dump from a flight recording, in bytes, if one of the following suffixes is not used: 'm' or 'M' for megabytes OR 'g' or 'G' for gigabytes. (STRING, no default value)
  • name โ€” (optional) the name of the recording. If no name is given, data from all recordings is dumped. (STRING, no default value)
  • path-to-gc-roots โ€” (optional) flag for saving the path to garbage collection (GC) roots at the time the recording data is dumped. The path information is useful for finding memory leaks, but collecting it can cause the application to pause for a short period of time ๐Ÿ˜ญ. Turn on this flag only when you have an application that you suspect has a memory leak. (BOOLEAN, false)

๐ŸŒธ JFR.start [options] ๐ŸŒธ

Start a flight recording. Main character energy fr.

Impact: Low

Note ๐Ÿ’–

The options must be specified using either key or key=value syntax. If no parameters are entered, then a recording is started with default values โ€” yes, zero-argument slay.

options:

  • delay โ€” (optional) the length of time to wait before starting to record. (INTEGER followed by 's' for seconds, 'm' for minutes or 'h' for hours, 0s)
  • disk โ€” (optional) flag for also writing the data to disk while recording. (BOOLEAN, true)
  • dumponexit โ€” (optional) flag for writing the recording to disk when the Java Virtual Machine (JVM) shuts down. If set to 'true' and no value is given for filename, the recording is written to a file in the directory where the process was started. The file name is a system-generated name that contains the process ID, the recording ID and the current time stamp. (For example: id-1-2019_12_12_10_41.jfr) (BOOLEAN, false)
  • duration โ€” (optional) the length of time to record. Note that 0s means forever โ™พ๏ธ. (INTEGER followed by 's' for seconds, 'm' for minutes or 'h' for hours, 0s)
  • filename โ€” (optional) the name of the file to which the flight recording data is written when the recording is stopped. If no filename is given, a filename is generated from the PID and the current date and is placed in the directory where the process was started. The filename may also be a directory, in which case the filename is generated from the PID and the current date in the specified directory. If %p and/or %t is specified in the filename, it expands to the JVM's PID and the current timestamp, respectively. (FILE, no default value)
  • maxage โ€” (optional) the maximum time to keep the recorded data on disk. This parameter is valid only when the disk parameter is set to true. Note: 0s means forever. (INTEGER followed by 's' for seconds, 'm' for minutes or 'h' for hours, 0s)
  • maxsize โ€” (optional) the maximum size of the data to keep on disk, in bytes, if one of the following suffixes is not used: 'm' or 'M' for megabytes OR 'g' or 'G' for gigabytes. This parameter is valid only when the disk parameter is set to 'true'. The value must not be less than the value for the maxchunksize parameter set with the JFR.configure command. (STRING, 0 (no maximum size))
  • name โ€” (optional) the name of the recording. If no name is provided, a name is generated. Make note of the generated name that is shown in the response to the command so that you can use it with other commands โ€” write it down bestie, you will need it later. (STRING, system-generated default name)
  • path-to-gc-roots โ€” (optional) flag for saving the path to garbage collection (GC) roots at the end of a recording. The path information is useful for finding memory leaks, but collecting it is time consuming. Turn on this flag only when you have an application that you suspect has a memory leak. If the settings parameter is set to 'profile', then the information collected includes the stack trace from where the potential leaking object was allocated. (BOOLEAN, false)
  • settings โ€” (optional) the name of the settings file that identifies which events to record. To specify more than one file, separate the names with a comma (','). Include the path if the file is not in JAVA-HOME/lib/jfr. The following profiles are included with the JDK in the JAVA-HOME/lib/jfr directory: 'default.jfc' collects a predefined set of information with low overhead, so it has minimal impact on performance and can be used with recordings that run continuously; 'profile.jfc' provides more data than the 'default.jfc' profile, but with more overhead and impact on performance โ€” use this configuration for short periods of time when more information is needed. Use none to start a recording without a predefined configuration file. (STRING, JAVA-HOME/lib/jfr/default.jfc) ๐Ÿฆ‹

Event settings and .jfc options can be specified using the following syntax:

  • option โ€” (optional) specifies the option value to modify. To list available options, use the JAVA_HOME/bin/jfr tool.
  • event-setting โ€” (optional) specifies the event setting value to modify. Use the form: <event-name>#<setting-name>=<value>. To add a new event setting, prefix the event name with '+'.

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 parameter wins, no debate ๐Ÿ’…. The whitespace delimiter can be omitted for timespan values, i.e. 20ms. For more information about the settings syntax, see the Javadoc of the jdk.jfr package.


๐Ÿ’€ JFR.stop [options] ๐Ÿ’€

Stop a flight recording. Rip to the recording ๐Ÿซก.

Impact: Low

Note ๐Ÿ’–

The options must be specified using either key or key=value syntax. If no parameters are entered, then no recording is stopped โ€” that's right, calling it with nothing stops nothing, iconic behaviour honestly.

options:

  • filename โ€” (Optional) bestie, this is the name of the file where the recording gets written when the recording is stopped. If %p and/or %t is in the filename, it expands to the JVM's PID and the current timestamp, respectively. If no path is provided, the data from the recording is discarded. (FILE, no default value) ๐Ÿ’พ
  • name โ€” (Optional) the name of the recording. (STRING, no default value) โœจ

๐Ÿ” JFR.view [options]

Display event data in predefined views. It's giving "look at your JFR data, bestie." ๐Ÿ‘€

Impact: Medium

Note: the options must be specified using either key or key=value syntax. If no parameters are entered, then a list of available views are displayed. No cap.

options:

  • cell-height โ€” (Optional) maximum number of rows in a table cell. (INT, default value depends on the view) ๐Ÿ“
  • maxage โ€” (Optional) length of time for the view to span. (INT followed by 's' for seconds, 'm' for minutes, or 'h' for hours, default value is 10m) โณ
  • maxsize โ€” (Optional) maximum size for the view to span in bytes if one of the following suffixes is not used: 'm' or 'M' for megabytes OR 'g' or 'G' for gigabytes. (STRING, default value is 32MB) ๐Ÿงฎ
  • truncate โ€” (Optional) maximum number of rows in a table cell. (INT, default value depends on the view) โœ‚๏ธ
  • verbose โ€” (Optional) displays the query that makes up the view. (BOOLEAN, default value is false) ๐Ÿ—ฃ๏ธ
  • width โ€” (Optional) the width of the view in characters. (INT, default value depends on the view) ๐Ÿ“

arguments:

  • view โ€” name of the view or event type to display. Use help JFR.view to see a list of available views. (STRING, no default value) ๐ŸŒธ

The view parameter can be an event type name. Use JFR.view types to see a list. To display all views, use JFR.view all-views. To display all events, use JFR.view all-events. Literally so many options, iykyk. ๐Ÿ’…


๐Ÿงš JVMTI.agent_load [arguments]

Loads JVMTI native agent. Lowkey iconic for native-agent girlies. ๐Ÿงšโ€โ™€๏ธ

Impact: Low

arguments:

  • library path โ€” absolute path of the JVMTI agent to load. (STRING, no default value) ๐Ÿ“‚
  • agent option โ€” (Optional) option string to pass the agent. (STRING, no default value) ๐ŸŽ€

๐Ÿ’ฅ JVMTI.data_dump

Signal the JVM to do a data-dump request for JVMTI. Highkey a big deal. ๐Ÿซก

Impact: High


๐Ÿ‘‘ ManagementAgent.start [options]

Starts remote management agent. Main character energy for your JMX setup. ๐Ÿ‘‘

Impact: Low --- no impact

Note: the following options must be specified using either key or key=value syntax.

options:

  • config.file โ€” (Optional) sets com.sun.management.config.file (STRING, no default value) ๐Ÿ“
  • jmxremote.host โ€” (Optional) sets com.sun.management.jmxremote.host (STRING, no default value) ๐Ÿ 
  • jmxremote.port โ€” (Optional) sets com.sun.management.jmxremote.port (STRING, no default value) ๐Ÿ”Œ
  • jmxremote.rmi.port โ€” (Optional) sets com.sun.management.jmxremote.rmi.port (STRING, no default value) ๐ŸŒ€
  • jmxremote.ssl โ€” (Optional) sets com.sun.management.jmxremote.ssl (STRING, no default value) ๐Ÿ”
  • jmxremote.registry.ssl โ€” (Optional) sets com.sun.management.jmxremote.registry.ssl (STRING, no default value) ๐Ÿ“š
  • jmxremote.authenticate โ€” (Optional) sets com.sun.management.jmxremote.authenticate (STRING, no default value) ๐Ÿชช
  • jmxremote.password.file โ€” (Optional) sets com.sun.management.jmxremote.password.file (STRING, no default value) ๐Ÿ”‘
  • jmxremote.access.file โ€” (Optional) sets com.sun.management.jmxremote.acce ss.file (STRING, no default value) ๐Ÿ—‚๏ธ
  • jmxremote.login.config โ€” (Optional) sets com.sun.management.jmxremote.log in.config (STRING, no default value) ๐Ÿงพ
  • jmxremote.ssl.enabled.cipher.suites โ€” (Optional) sets com.sun.management. โ€” yes, bestie, that's where this line ends in the source. ๐Ÿซ 
  • jmxremote.ssl.enabled.cipher.suite โ€” (STRING, no default value) โ€” this is the other half of that split line, fr fr. ๐Ÿงฉ
  • jmxremote.ssl.enabled.protocols โ€” (Optional) sets com.sun.management.jmxr emote.ssl.enabled.protocols (STRING, no default value) ๐Ÿ“ก
  • jmxremote.ssl.need.client.auth โ€” (Optional) sets com.sun.management.jmxre mote.need.client.auth (STRING, no default value) ๐Ÿ›ก๏ธ
  • jmxremote.ssl.config.file โ€” (Optional) sets com.sun.management.jmxremote. ssl_config_file (STRING, no default value) ๐Ÿ“„
  • jmxremote.autodiscovery โ€” (Optional) sets com.sun.management.jmxremote.au todiscovery (STRING, no default value) ๐Ÿ›ฐ๏ธ
  • jdp.port โ€” (Optional) sets com.sun.management.jdp.port (INT, no default value) ๐Ÿ”ข
  • jdp.address โ€” (Optional) sets com.sun.management.jdp.address (STRING, no default value) ๐Ÿ“ฌ
  • jdp.source_addr โ€” (Optional) sets com.sun.management.jdp.source_addr (STRING, no default value) ๐Ÿ“ฎ
  • jdp.ttl โ€” (Optional) sets com.sun.management.jdp.ttl (INT, no default value) โฒ๏ธ
  • jdp.pause โ€” (Optional) sets com.sun.management.jdp.pause (INT, no default value) โธ๏ธ
  • jdp.name โ€” (Optional) sets com.sun.management.jdp.name (STRING, no default value) ๐Ÿท๏ธ

๐Ÿก ManagementAgent.start_local

Starts the local management agent. Local vibes only. ๐Ÿก

Impact: Low --- no impact


๐Ÿ“Š ManagementAgent.status

Print the management agent status. Vibe check for your agent. ๐Ÿ“Š

Impact: Low --- no impact


๐Ÿ›‘ ManagementAgent.stop

Stops the remote management agent. Slay, but make it shutdown. ๐Ÿ›‘

Impact: Low --- no impact


๐Ÿ—บ๏ธ System.dump_map [options] (Linux only)

Dumps an annotated process memory map to an output file. Linux besties, this one's for you. ๐Ÿง

Impact: Low

Note: the following options must be specified using either key or key=value syntax.

options:

  • -H โ€” (Optional) human readable format (BOOLEAN, false) ๐Ÿง 
  • -F โ€” (Optional) file path. If %p is specified in the filename, it is expanded to the JVM's PID. (FILE, "vm_memory_map_%p.txt") ๐Ÿ“

๐Ÿงญ System.map [options] (Linux only)

Prints an annotated process memory map of the VM process. Memory map realness. ๐Ÿงญ

Impact: Low

Note: the following options must be specified using either key or key=value syntax.

options:

  • -H โ€” (Optional) human readable format (BOOLEAN, false) ๐Ÿง 

๐ŸŒฟ System.native_heap_info (Linux only)

Attempts to output information regarding native heap usage through malloc_info(3). If unsuccessful outputs "Error: " and a reason. Ngl, when it works it works. ๐ŸŒฟ

Impact: Low


๐Ÿงน System.trim_native_heap (Linux only)

Attempts to free up memory by trimming the C-heap. Cleanup era. ๐Ÿงน

Impact: Low


๐Ÿงต Thread.dump_to_file [options] filepath

Dump all threads, with stack traces, to a file in plain text or JSON format. Thread tea, spilled to disk. ๐Ÿงต

Impact: Medium: Depends on the number of threads.

Note: the following options must be specified using either key or key=value syntax.

options:

  • -overwrite โ€” (Optional) may overwrite existing file (BOOLEAN, false) โš ๏ธ
  • -format โ€” (Optional) output format ("plain" or "json") (STRING, plain) ๐ŸŽ›๏ธ

arguments:

  • filepath โ€” the file path to the output file. If %p is specified in the filename, it is expanded to the JVM's PID. (FILE, no default value) ๐Ÿ“„

๐Ÿ–จ๏ธ Thread.print [options]

Print all platform threads, and mounted virtual threads, with stack traces. The Thread.dump_to_file command will print all threads to a file. So yes, there's a file option too, bestie. ๐Ÿ–จ๏ธ

Impact: Medium --- depends on the number of threads.

Note: the following options must be specified using either key or key=value syntax.

options:

  • -e โ€” (Optional) print extended thread information (BOOLEAN, false) ๐Ÿ”Ž
  • -l โ€” (Optional) prints java.util.concurrent locks (BOOLEAN, false) ๐Ÿ”’

๐Ÿงšโ€โ™€๏ธ Thread.vthread_scheduler

Print the virtual thread scheduler, and the delayed task schedulers that support virtual threads doing timed operations. Virtual thread scheduler lore. ๐Ÿงšโ€โ™€๏ธ

Impact: Low


๐ŸŒ€ Thread.vthread_pollers

Print the I/O pollers that support virtual threads doing blocking network I/O operations. Poller girlies rise. ๐ŸŒ€

Impact: Low


๐Ÿ“ฆ VM.cds [arguments]

Dump a static or dynamic shared archive that includes all currently loaded classes. CDS archive moment. ๐Ÿ“ฆ

Impact: Medium --- pause time depends on number of loaded classes

arguments:

  • subcmd โ€” must be either static_dump or dynamic_dump (STRING, no default value) ๐Ÿงญ
  • filename โ€” (Optional) name of the shared archive to be dumped. If %p is specified in the filename, it is expanded to the JVM's PID. (FILE, "java_pid%p_<subcmd>.jsa") ๐Ÿ—ƒ๏ธ

If dynamic_dump is specified, the target JVM must be started with the JVM option -XX:+RecordDynamicDumpInfo. No cap, that's required. ๐Ÿšจ


๐ŸŒณ VM.class_hierarchy [options] [arguments]

Print 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. Class hierarchy tree, but make it diagnostic. ๐ŸŒณ

Impact: Medium --- depends on the number of loaded classes.

Note: the following options must be specified using either key or key=value syntax.

options:

  • -i โ€” (Optional) inherited interfaces should be printed. (BOOLEAN, false) ๐Ÿงฌ
  • -s โ€” (Optional) if a classname is specified, print its subclasses in addition to its superclasses. Without this option only the superclasses will be printed. (BOOLEAN, false) ๐ŸŒฟ

arguments:

  • classname โ€” (Optional) the name of the class whose hierarchy should be printed. If not specified, all class hierarchies are printed. (STRING, no default value) ๐Ÿท๏ธ

๐Ÿ“š VM.classes [options]

Print all loaded classes. The full class roster, periodt. ๐Ÿ“š

Impact: Medium: Depends on number of loaded classes.

The following options must be specified using either key or key=value syntax.

options:

  • -verbose โ€” (Optional) dump the detailed content of a Java class. Some classes are annotated with flags: F = has, or inherits, a non-empty finalize method, f = has final method, W = methods rewritten, C = marked with @Contended annotation, R = has been redefined, S = is shared class (BOOLEAN, false) ๐Ÿ”ฌ

๐Ÿซถ VM.classloader_stats

Prints out stats about, like, all the ClassLoaders. Every single one. No cap.

Impact: Low


๐ŸŒธ VM.classloaders [options]

Prints the whole classloader hierarchy, like a little family tree but for loaders. Iconic.

Impact: Medium โ€” depends on how many class loaders and classes are loaded, so bestie, it can get thicc.

Heads up: these options must be written using either key or key=value syntax. Pick a lane, either is fine.

options:

  • show-classes โ€” (Optional) prints the loaded classes too. BOOLEAN, defaults to false.
  • verbose โ€” (Optional) prints the detailed info, the unfiltered version. BOOLEAN, defaults to false.
  • fold โ€” (Optional) treats loaders with the same name and class as one single loader, which is lowkey a lifesaver. BOOLEAN, defaults to true.

๐ŸŽ€ VM.command_line

Prints the command line that was used to start this VM instance. Receipts, basically. ๐Ÿ’…

Impact: Low


๐Ÿฆ‹ VM.dynlibs

Prints all the loaded dynamic libraries. Every single one that got pulled in.

Impact: Low


โญ VM.events [options]

Prints the VM event logs. Detective mode: activated. ๐Ÿ”

Impact: Low โ€” depends on how big the event log is.

Note: the following options must be specified using either key or key=value syntax.

options:

  • log โ€” (Optional) the name of the log to print. If you omit it, all logs get printed. STRING, no default value.
  • max โ€” (Optional) the maximum number of events to print, newest first. If you omit it, or set it to zero, all events get printed. INT, defaults to 0.

๐Ÿงš VM.flags [options]

Prints the VM flag options and what their current values actually are. The truth, the whole truth.

Impact: Low

Note: the following options must be specified using either key or key=value syntax.

options:

  • -all โ€” (Optional) prints every flag the VM supports. All of them. Absolute unit of a list. BOOLEAN, defaults to false.

๐Ÿ’œ VM.info

Prints all the info about the JVM environment and its status. Like a little ~status update~ for your JVM.

Impact: Low


๐ŸŒˆ VM.log [options]

This one's the multitasker: it lists your current log configuration, enables/disables/configures a log output, or rotates all the logs. Main character energy, fr.

Impact: Low

Note: the following options must be specified using either key or key=value syntax.

options:

  • output โ€” (Optional) the name or the index (#) of the output you want to configure. STRING, no default value.
  • output_options โ€” (Optional) options for that output. STRING, no default value.
  • what โ€” (Optional) configures which tags to log. STRING, no default value.
  • decorators โ€” (Optional) configures which decorators to use. Use 'none' or an empty value to remove all of them. STRING, no default value.
  • disable โ€” (Optional) turns off all logging and clears the log configuration. BOOLEAN, no default value.
  • list โ€” (Optional) lists the current log configuration. BOOLEAN, no default value.
  • rotate โ€” (Optional) rotates all the logs. BOOLEAN, no default value.

๐Ÿ“ VM.metaspace [options]

Prints the statistics for the metaspace. Number-crunching time, bestie. ๐Ÿ“Š

Impact: Medium โ€” depends on the number of classes loaded.

Note: the following options must be specified using either key or key=value syntax.

options:

  • basic โ€” (Optional) prints a basic summary. And good news: it doesn't need a safepoint. BOOLEAN, defaults to false.
  • show-loaders โ€” (Optional) shows usage broken down by class loader. BOOLEAN, defaults to false.
  • show-classes โ€” (Optional) if show-loaders is set, shows the loaded classes for each loader. BOOLEAN, defaults to false.
  • by-chunktype โ€” (Optional) breaks the numbers down by chunk type. BOOLEAN, defaults to false.
  • by-spacetype โ€” (Optional) breaks the numbers down by loader type. BOOLEAN, defaults to false.
  • vslist โ€” (Optional) shows details about the underlying virtual space. BOOLEAN, defaults to false.
  • chunkfreelist โ€” (Optional) shows details about the global chunk free lists (ChunkManager). BOOLEAN, defaults to false.
  • scale โ€” (Optional) which memory-usage scale to use. Valid values are: 1, KB, MB or GB (that's a fixed scale) or "dynamic" for a scale that gets chosen dynamically. STRING, defaults to dynamic.

๐Ÿ”ฅ VM.native_memory [options]

Prints native memory usage. All the memory tea. โ˜•

Impact: Medium

Note: the following options must be specified using either key or key=value syntax.

options:

  • summary โ€” (Optional) asks the runtime to report the current memory summary, which includes total reserved and committed memory, plus a memory usage summary for each subsystem. BOOLEAN, defaults to false.
  • detail โ€” (Optional) asks the runtime to report memory allocation >= 1K by each callsite. BOOLEAN, defaults to false.
  • baseline โ€” (Optional) asks the runtime to baseline the current memory usage so you can compare against it later. Setting a benchmark, basically. BOOLEAN, defaults to false.
  • summary.diff โ€” (Optional) asks the runtime to report the memory summary comparison against the previous baseline. BOOLEAN, defaults to false.
  • detail.diff โ€” (Optional) asks the runtime to report the memory detail comparison against the previous baseline, which shows the memory allocation activity at different callsites. BOOLEAN, defaults to false.
  • statistics โ€” (Optional) prints tracker statistics, for tuning purposes. BOOLEAN, defaults to false.
  • scale โ€” (Optional) which scale to use for memory usage: KB, MB or GB. STRING, defaults to KB.

๐Ÿ’… VM.set_flag [arguments]

Sets a VM flag option using the value you hand it. You're the one in control now. ๐Ÿ‘‘

Impact: Low

arguments:

  • flag name โ€” the name of the flag you want to set. STRING, no default value.
  • string value โ€” (Optional) the value you want to set it to. STRING, no default value.

๐ŸŽ€ VM.stringtable [options]

Dumps the string table. The whole table. ๐Ÿ—‚๏ธ

Impact: Medium โ€” depends on the Java content.

Note: the following options must be specified using either key or key=value syntax.

options:

  • -verbose โ€” (Optional) dumps the content of each string in the table. BOOLEAN, defaults to false.

๐Ÿฆ‹ VM.symboltable [options]

Dumps the symbol table. Same energy, different table.

Impact: Medium โ€” depends on the Java content.

Note: the following options must be specified using either key or key=value syntax).

options:

  • -verbose โ€” (Optional) dumps the content of each symbol in the table. BOOLEAN, defaults to false.

๐ŸŒธ VM.system_properties

Prints the system properties. The whole little dictionary of them. ๐Ÿ’–

Impact: Low


๐Ÿงš VM.systemdictionary

Prints the statistics for the dictionary hashtable sizes and bucket length. Very numbers, much wow.

Impact: Medium

Note: the following options must be specified using either key or key=value syntax.

options:

  • verbose โ€” (Optional) dumps the content of every dictionary entry for all class loaders. BOOLEAN, defaults to false.

๐ŸŒˆ VM.uptime [options]

Prints how long the VM has been up. The VM's screen time, if you will. โฑ๏ธ

Impact: Low

Note: the following options must be specified using either key or key=value syntax.

options:

  • -date โ€” (Optional) adds a prefix with the current date, so you know exactly when that uptime was measured. BOOLEAN, defaults to false.

๐Ÿ’œ VM.version

Prints the JVM version information. Say hi to your JVM's version, bestie. ๐Ÿ‘‹

Impact: Low


That's the whole page, babes โ€” every single command, flag and default accounted for, zero facts dropped. ๐Ÿซถ

This lil masterpiece is from JDK 27-ea, dated 2026, and it lives in section JCMD(1) of the manual. Go forth and jcmd responsibly. ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from
  • epel 10: java-latest-openjdk-devel 1:27.0.0.0.35-0.0.1.0.ea.el10_3 ยท Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 10: java-latest-openjdk-devel-fastdebug 1:27.0.0.0.35-0.0.1.0.ea.el10_3 ยท Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 10: java-latest-openjdk-devel-slowdebug 1:27.0.0.0.35-0.0.1.0.ea.el10_3 ยท Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 9: java-latest-openjdk-devel 1:27.0.0.0.35-0.0.1.0.ea.el9 ยท Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 9: java-latest-openjdk-devel-fastdebug 1:27.0.0.0.35-0.0.1.0.ea.el9 ยท Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 9: java-latest-openjdk-devel-slowdebug 1:27.0.0.0.35-0.0.1.0.ea.el9 ยท Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms