JCMD(1)
๐ 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, thejcmdutility sends the diagnostic command request to the process ID for the Java process. ๐ซถmain-classโ when used, thejcmdutility 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 validjcmdcommand for the selected JVM. The list of available commands forjcmdis obtained by running thehelpcommand (jcmd pid help), wherepidis 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 itPerfCounter.printwith a capital C; that's literally what the page says. ๐ )-ffilename โ 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 aspsto look up the PID. Lowkey important: usingjcmdwithout arguments is the same as usingjcmd -l. ๐ณ-hโ displays thejcmdutility'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 eitherkeyorkey=valuesyntax.
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=recordor-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 eitherkeyorkey=valuesyntax.
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%pis 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 eitherkeyorkey=valuesyntax.
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.1means 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 eitherkeyorkey=valuesyntax.
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,9the 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%pis 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 eitherkeyorkey=valuesyntax. 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 eitherkeyorkey=valuesyntax. 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 thememorysizeparameter to alter the number of global buffers. This value cannot be changed once JFR has been initialized. (STRING, default determined by the value formemorysize). 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 thememorysizeparameter instead. And once JFR has been initialized, this value is locked in forever, no takebacks. (STRING, default determined by the value formemorysize)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 theTMPenvironment variable.)preserve-repository={true|false}โ specifies whether files stored in the disk repository should be kept after the JVM has exited. Iffalse, files are deleted. By default, this parameter is disabled. ๐๏ธstackdepthโ (optional) the stack depth for stack traces. Setting this value greater than the default of64may 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 bothbeginandend, the time must be in a format that can be read byjava.time.LocalTime::parse(STRING),java.time.LocalDateTime::parse(STRING)orjava.time.Instant::parse(STRING). For example,"13:20:15","2020-03-17T09:00:00"or"2020-03-17T09:00:00Z".
Note:beginandendtimes 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%pand/or%tis 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 forfilename, 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 that0smeans 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%pand/or%tis 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 thediskparameter is set totrue. Note:0smeans 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 thediskparameter is set to'true'. The value must not be less than the value for themaxchunksizeparameter set with theJFR.configurecommand. (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 thesettingsparameter 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 inJAVA-HOME/lib/jfr. The following profiles are included with the JDK in theJAVA-HOME/lib/jfrdirectory:'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. Usenoneto 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 theJAVA_HOME/bin/jfrtool.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%pand/or%tis 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 eitherkeyorkey=valuesyntax. 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. (INTfollowed by's'for seconds,'m'for minutes, or'h'for hours, default value is10m) โณ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 is32MB) ๐งฎ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 isfalse) ๐ฃ๏ธ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. Usehelp JFR.viewto 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 eitherkeyorkey=valuesyntax.
options:
config.fileโ (Optional) setscom.sun.management.config.file(STRING, no default value) ๐jmxremote.hostโ (Optional) setscom.sun.management.jmxremote.host(STRING, no default value) ๐jmxremote.portโ (Optional) setscom.sun.management.jmxremote.port(STRING, no default value) ๐jmxremote.rmi.portโ (Optional) setscom.sun.management.jmxremote.rmi.port(STRING, no default value) ๐jmxremote.sslโ (Optional) setscom.sun.management.jmxremote.ssl(STRING, no default value) ๐jmxremote.registry.sslโ (Optional) setscom.sun.management.jmxremote.registry.ssl(STRING, no default value) ๐jmxremote.authenticateโ (Optional) setscom.sun.management.jmxremote.authenticate(STRING, no default value) ๐ชชjmxremote.password.fileโ (Optional) setscom.sun.management.jmxremote.password.file(STRING, no default value) ๐jmxremote.access.fileโ (Optional) setscom.sun.management.jmxremote.acce ss.file(STRING, no default value) ๐๏ธjmxremote.login.configโ (Optional) setscom.sun.management.jmxremote.log in.config(STRING, no default value) ๐งพjmxremote.ssl.enabled.cipher.suitesโ (Optional) setscom.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) setscom.sun.management.jmxr emote.ssl.enabled.protocols(STRING, no default value) ๐กjmxremote.ssl.need.client.authโ (Optional) setscom.sun.management.jmxre mote.need.client.auth(STRING, no default value) ๐ก๏ธjmxremote.ssl.config.fileโ (Optional) setscom.sun.management.jmxremote. ssl_config_file(STRING, no default value) ๐jmxremote.autodiscoveryโ (Optional) setscom.sun.management.jmxremote.au todiscovery(STRING, no default value) ๐ฐ๏ธjdp.portโ (Optional) setscom.sun.management.jdp.port(INT, no default value) ๐ขjdp.addressโ (Optional) setscom.sun.management.jdp.address(STRING, no default value) ๐ฌjdp.source_addrโ (Optional) setscom.sun.management.jdp.source_addr(STRING, no default value) ๐ฎjdp.ttlโ (Optional) setscom.sun.management.jdp.ttl(INT, no default value) โฒ๏ธjdp.pauseโ (Optional) setscom.sun.management.jdp.pause(INT, no default value) โธ๏ธjdp.nameโ (Optional) setscom.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 eitherkeyorkey=valuesyntax.
options:
-Hโ (Optional) human readable format (BOOLEAN,false) ๐ง-Fโ (Optional) file path. If%pis 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 eitherkeyorkey=valuesyntax.
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 eitherkeyorkey=valuesyntax.
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%pis 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 eitherkeyorkey=valuesyntax.
options:
-eโ (Optional) print extended thread information (BOOLEAN,false) ๐-lโ (Optional) printsjava.util.concurrentlocks (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 eitherstatic_dumpordynamic_dump(STRING, no default value) ๐งญfilenameโ (Optional) name of the shared archive to be dumped. If%pis 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 eitherkeyorkey=valuesyntax.
options:
-iโ (Optional) inherited interfaces should be printed. (BOOLEAN,false) ๐งฌ-sโ (Optional) if aclassnameis 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-emptyfinalizemethod,f= has final method,W= methods rewritten,C= marked with@Contendedannotation,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 eitherkeyorkey=valuesyntax. Pick a lane, either is fine.
options:
show-classesโ (Optional) prints the loaded classes too.BOOLEAN, defaults tofalse.verboseโ (Optional) prints the detailed info, the unfiltered version.BOOLEAN, defaults tofalse.foldโ (Optional) treats loaders with the same name and class as one single loader, which is lowkey a lifesaver.BOOLEAN, defaults totrue.
๐ 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 eitherkeyorkey=valuesyntax.
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 to0.
๐ง 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 eitherkeyorkey=valuesyntax.
options:
-allโ (Optional) prints every flag the VM supports. All of them. Absolute unit of a list.BOOLEAN, defaults tofalse.
๐ 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 eitherkeyorkey=valuesyntax.
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 eitherkeyorkey=valuesyntax.
options:
basicโ (Optional) prints a basic summary. And good news: it doesn't need a safepoint.BOOLEAN, defaults tofalse.show-loadersโ (Optional) shows usage broken down by class loader.BOOLEAN, defaults tofalse.show-classesโ (Optional) ifshow-loadersis set, shows the loaded classes for each loader.BOOLEAN, defaults tofalse.by-chunktypeโ (Optional) breaks the numbers down by chunk type.BOOLEAN, defaults tofalse.by-spacetypeโ (Optional) breaks the numbers down by loader type.BOOLEAN, defaults tofalse.vslistโ (Optional) shows details about the underlying virtual space.BOOLEAN, defaults tofalse.chunkfreelistโ (Optional) shows details about the global chunk free lists (ChunkManager).BOOLEAN, defaults tofalse.scaleโ (Optional) which memory-usage scale to use. Valid values are:1,KB,MBorGB(that's a fixed scale) or"dynamic"for a scale that gets chosen dynamically.STRING, defaults todynamic.
๐ฅ VM.native_memory [options]
Prints native memory usage. All the memory tea. โ
Impact: Medium
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
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 tofalse.detailโ (Optional) asks the runtime to report memory allocation>= 1Kby each callsite.BOOLEAN, defaults tofalse.baselineโ (Optional) asks the runtime to baseline the current memory usage so you can compare against it later. Setting a benchmark, basically.BOOLEAN, defaults tofalse.summary.diffโ (Optional) asks the runtime to report the memory summary comparison against the previous baseline.BOOLEAN, defaults tofalse.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 tofalse.statisticsโ (Optional) prints tracker statistics, for tuning purposes.BOOLEAN, defaults tofalse.scaleโ (Optional) which scale to use for memory usage:KB,MBorGB.STRING, defaults toKB.
๐
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 eitherkeyorkey=valuesyntax.
options:
-verboseโ (Optional) dumps the content of each string in the table.BOOLEAN, defaults tofalse.
๐ฆ 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 eitherkeyorkey=valuesyntax).
options:
-verboseโ (Optional) dumps the content of each symbol in the table.BOOLEAN, defaults tofalse.
๐ธ 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 eitherkeyorkey=valuesyntax.
options:
verboseโ (Optional) dumps the content of every dictionary entry for all class loaders.BOOLEAN, defaults tofalse.
๐ 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 eitherkeyorkey=valuesyntax.
options:
-dateโ (Optional) adds a prefix with the current date, so you know exactly when that uptime was measured.BOOLEAN, defaults tofalse.
๐ 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