JCMD(1)
π jcmd(1) β JDK Commands π
πΈ NAME πΈ
Okay bestie, jcmd is literally the utility that sends diagnostic command requests to a running Java Virtual Machine (JVM). π
β¨ SYNOPSIS β¨
jcmd [pid | main-class] command... | PerfCounter.print | -f filename
jcmd [-l]
jcmd -h
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.commandβ The 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.Perfcounter.printβ Prints the performance counters exposed by the specified Java process.-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 aspsto look up the PID. Note: Usingjcmdwithout arguments is the same as usingjcmd -l.-hβ Displays thejcmdutility's command-line help.
π¦ DESCRIPTION π¦
The jcmd 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. No cap. 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).
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.
π₯ 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.
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) .
AOT.end_recordingβ Ends an in-progress AOT training and records the results to the file(s) specified by-XX:AOTConfigurationand/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. HoldsCodeCache_lockduring analysis step, usually sub-second duration. arguments:function: (Optional) Function to be performed (aggregate,UsedSpace,FreeSpace,MethodCount,MethodSpace,MethodAge,MethodNames,discard(STRING, all)granularity: (Optional) Detail level - smaller value -> more detail (INT, 4096)
Compiler.codecacheβ Prints code cache layout and bounds. Impact: LowCompiler.codelistβ Prints all compiled methods in code cache that are alive. Impact: MediumCompiler.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: LowCompiler.directives_printβ Prints all active compiler directives. Impact: LowCompiler.directives_removeβ Remove latest added compiler directive. Impact: LowCompiler.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)-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")
Compiler.queueβ Prints methods queued for compilation. Impact: LowGC.class_histogram [options]β Provides statistics about the Java heap usage. Impact: High --- depends on Java heap size and content. Note: The options must be specified using eitherkeyorkey=valuesyntax. options:-all: (Optional) Inspects all objects, including unreachable objects (BOOLEAN, false)-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)
GC.finalizer_infoβ Provides information about the Java finalization queue. Impact: MediumGC.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-alloption is specified. 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)-overwrite: (Optional) If specified, the dump file will be overwritten if it exists (BOOLEAN, false)-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: MediumGC.runβ Callsjava.lang.System.gc(). Impact: Medium --- depends on the Java heap size and content.GC.run_finalizationβ Callsjava.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)
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)globalbuffersize: (Optional) Size of the global buffers, in bytes. This option is a legacy option: change thememorysizeparameter to alter the size of the global buffers. This value cannot be changed once JFR has been initialized. (STRING, default determined by the value formemorysize)maxchunksize: (Optional) Maximum size of an individual data chunk in bytes if one of the following suffixes is not used:'m'or'M'for megabytes OR'g'or'G'for gigabytes. This value cannot be changed once JFR has been initialized. (STRING, 12M)
memorysizeβ (Optional) how much memory overall, in bytes unless you slap one of these suffixes on it:'m'or'M'for megabytes OR'g'or'G'for gigabytes. Heads up tho β you literally cannot change this once JFR has been initialized. (STRING,10M)repositorypathβ (Optional) the path to where recordings chill until they get written out 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 Windwows, the temporary directory is specified by theTMPenvironment variable.) π«Άpreserve-repository={true|false}β says whether files sitting in the disk repository should be kept after the JVM has exited. Iffalse, files get deleted. By default this parameter is disabled. ποΈstackdepthβ (Optional) stack depth for stack traces. Setting this higher than the default of64may cause a performance degradation π so likeβ¦ don't. Also cannot be changed once JFR has been initialized. (LONG,64)thread_buffer_sizeβ (Optional) local buffer size for each thread, in bytes unless one of these suffixes is used:'k'or'K'for kilobytes or'm'or'M'for megabytes. Overriding this parameter could reduce performance and is not recommended. Cannot be changed once JFR has been initialized. (STRING,8k)samplethreadsβ (Optional) 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. The recording keeps running after the data is written β it's giving "dump and keep going", iconic. 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
beginandend, 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 inside the recorded information in the flight recording data. iykyk. - Another option is to use a time relative to the current time, specified by a negative integer followed by
"s","m"or"h". For example,"-12h","-15m"or"-30s". β°
- Note: for both
filenameβ (Optional) name of the file the flight recording data gets dumped into. 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) 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) maximum size for the amount of data to dump from a flight recording, in bytes if one of the following suffixes isn't used:'m'or'M'for megabytes OR'g'or'G'for gigabytes. (STRING, no default value)nameβ (Optional) 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. 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. options:
delayβ (Optional) 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) length of time to record. Note that0smeans forever βΎοΈ (INTEGER followed by's'for seconds'm'for minutes or'h'for hours,0s)filenameβ (Optional) name of the file the flight recording data is written to 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) maximum time to keep the recorded data on disk. This parameter is valid only when thediskparameter is set totrue. Note0smeans forever. (INTEGER followed by's'for seconds'm'for minutes or'h'for hours,0s)maxsizeβ (Optional) 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) name of the recording. If no name is provided, a name is generated. Make note of the generated name that's shown in the response to the command so you can use it with other commands. π (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) 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.jfcoptions 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.jfcoptions by separating them with a whitespace. In case of a conflict between a parameter and a.jfcoption, 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 thejdk.jfrpackage. π§
π JFR.stop [options] π
Stop a flight 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. options:
filenameβ (Optional) name of the file the recording is written to when the recording is stopped. If%pand/or%tis specified 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) name of the recording. (STRING, no default value)
π¦ JFR.view [options] π¦
Display event data in predefined views. 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. options:
cell-heightβ (Optional) maximum number of rows in a table cell. (INT, default value depends on the view)maxageβ (Optional) how far back the view stretches in time. It's an INT followed bysfor seconds,mfor minutes, orhfor hours β default value is10m. β³maxsizeβ (Optional) the max size the view spans, in bytes unless you use one of these suffixes:morMfor megabytes ORgorGfor gigabytes. (STRING, default value is32MB) πtruncateβ (Optional) max number of rows in a table cell. (INT, default value depends on the view) βοΈverboseβ (Optional) shows you the actual query that makes up the view. (BOOLEAN, default value isfalse) πwidthβ (Optional) width of the view in characters. (INT, default value depends on the view) π
arguments:
viewβ the name of the view or event type to display. Runhelp JFR.viewto see a list of available views. (STRING, no default value) Theviewparameter can also be an event type name β useJFR.view typesto see a list of those. Wanna see all views?JFR.view all-views. All events?JFR.view all-events. easy π
π JVMTI.agent_load [arguments]
Loads a JVMTI native agent. π§
Impact: Low
arguments:
library pathβ absolute path of the JVMTI agent you're loading. (STRING, no default value)agent optionβ (Optional) option string to pass along to the agent. (STRING, no default value)
π₯ JVMTI.data_dump
Signals the JVM to do a data-dump request for JVMTI. dramatic but valid π
Impact: High
π ManagementAgent.start [options]
Starts the remote management agent.
Impact: Low β no impact
Note: the following options must be specified using eitherkeyorkey=valuesyntax. no cap, that's the rule π
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.jmxremote.ssl.enabled.cipher.suiteβ (STRING, no default value)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. lowkey the chill sibling π«Ά
Impact: Low β no impact
β ManagementAgent.status
Prints the management agent status. that's it, that's the whole vibe β¨
Impact: Low β no impact
π ManagementAgent.stop
Stops the remote management agent.
Impact: Low β no impact
π¦ System.dump_map [options] (Linux only)
Dumps an annotated process memory map to an output file. Linux girlies only π§
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%pshows up in the filename, it gets 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. map it out bestie πΊοΈ
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 about native heap usage through malloc_info(3). If it doesn't work out, it outputs "Error: " and a reason. at least it tells you why π
Impact: Low
πΏ System.trim_native_heap (Linux only)
Attempts to free up memory by trimming the C-heap. spring cleaning for your JVM π§Ή
Impact: Low
π«Ά Thread.dump_to_file [options] filepath
Dumps all threads, stack traces included, into a file β either plain text or JSON format. π
Impact: Medium: depends on the number of threads.
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
options:
-overwriteβ (Optional) May overwrite an existing file (BOOLEAN,false)-formatβ (Optional) Output format ("plain"or"json") (STRING,plain)
arguments:
filepathβ the file path of the output file. If%pis specified in the filename, it's expanded to the JVM's PID. (FILE, no default value)
π₯ Thread.print [options]
Prints all platform threads, and mounted virtual threads, with stack traces. The Thread.dump_to_file command will print all threads to a file instead, iykyk.
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
Prints the virtual thread scheduler, plus the delayed task schedulers that support virtual threads doing timed operations. β°
Impact: Low
π¦ Thread.vthread_pollers
Prints the I/O pollers that support virtual threads doing blocking network I/O operations. networking era π
Impact: Low
π VM.cds [arguments]
Dumps a static or dynamic shared archive that includes all currently loaded classes.
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's expanded to the JVM's PID. (FILE,"java_pid%p_<subcmd>.jsa") Ifdynamic_dumpis specified, the target JVM must be started with the JVM option-XX:+RecordDynamicDumpInfo. don't skip that part bestie, it literally won't work π
π VM.class_hierarchy [options] [arguments]
Prints a list of all loaded classes, indented so you can actually see the class hierarchy. Each class name is followed by the ClassLoaderData* of its ClassLoader, or "null" if it's loaded by the bootstrap class loader. π³
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 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]
Prints all loaded classes. the whole roster π
Impact: Medium: depends on number of loaded classes.
The following options must be specified using eitherkeyorkey=valuesyntax.
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@Contendedannotation,R= has been redefined,S= is shared class (BOOLEAN,false)
π VM.classloader_stats
Prints statistics about all ClassLoaders. numbers era π
Impact: Low
πΈ VM.classloaders [options]
Prints the classloader hierarchy.
Impact: Medium β depends on number of class loaders and classes loaded.
The following options must be specified using eitherkeyorkey=valuesyntax.
options:
show-classesβ (Optional) Print loaded classes. (BOOLEAN,false)verboseβ (Optional) Print detailed information. (BOOLEAN,false)foldβ (Optional) Show loaders of the same name and class as one. (BOOLEAN,true)
π§ VM.command_line
Prints the command line used to start this VM instance. receipts, basically π§Ύ
Impact: Low
π VM.dynlibs
Prints loaded dynamic libraries.
Impact: Low
πΏ VM.events [options]
Prints VM event logs. π
Impact: Low β depends on event log size.
options:
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
logβ (Optional) which log you want printed, bestie. Skip it and literally all the logs get printed. (STRING, no default value)maxβ (Optional) the max number of events to print, newest first. Omit it or pass zero and you get everything. (INT,0)
VM.flags [options] π©
Prints the VM flag options and what their current values are. Impact: Low
Note, babe: the following options must be specified using eitherkeyorkey=valuesyntax.
options:
-allβ (Optional) Prints every flag the VM supports. (BOOLEAN,false)
VM.info βΉοΈ
Prints all the info about the JVM environment and its status. Impact: Low
VM.log [options] π
Lists the current log configuration, enables / disables / configures a log output, or rotates all the logs. Impact: Low
options:
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
outputβ (Optional) the name or index (#) of the output you wanna configure. (STRING, no default value)output_optionsβ (Optional) the 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 yeet them all. (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. Impact: Medium --- depends on how many classes are loaded, so like, it varies.
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
options:
basicβ (Optional) prints a basic summary (this one doesn't need a safepoint, slay). (BOOLEAN,false)show-loadersβ (Optional) shows usage by class loader. (BOOLEAN,false)show-classesβ (Optional) ifshow-loadersis set, shows the loaded classes for each loader. (BOOLEAN,false)by-chunktypeβ (Optional) breaks the numbers down by chunk type. (BOOLEAN,false)by-spacetypeβ (Optional) breaks the numbers down by loader type. (BOOLEAN,false)vslistβ (Optional) shows the deets about the underlying virtual space. (BOOLEAN,false)chunkfreelistβ (Optional) shows the deets about the global chunk free lists (ChunkManager). (BOOLEAN,false)chunkfreelist-adjacent sweetness aside, next up:scaleβ (Optional) the memory usage scale. Valid values are:1,KB,MBorGB(fixed scale) or"dynamic"for a dynamically chosen scale. (STRING,dynamic)
VM.native_memory [options] π§¬
Prints native memory usage. 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,false)detailβ (Optional) asks the runtime to report memory allocation>= 1Kby each callsite. (BOOLEAN,false)baselineβ (Optional) asks the runtime to baseline the current memory usage, so you can compare against it later. (BOOLEAN,false)summary.diffβ (Optional) asks the runtime to report the memory summary compared against the previous baseline. (BOOLEAN,false)detail.diffβ (Optional) asks the runtime to report the memory detail compared against the previous baseline, which shows the memory allocation activity at the different callsites. (BOOLEAN,false)statisticsβ (Optional) prints tracker statistics for tuning purposes. (BOOLEAN,false)scaleβ (Optional) the memory usage scale:KB,MBorGB. (STRING,KB)
VM.set_flag [arguments] ποΈ
Sets a VM flag option using the value you give it. 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. 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,false)
VM.symboltable [options] π£
Dumps the symbol 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,false)
VM.system_properties ποΈ
Prints the system properties. Impact: Low
VM.systemdictionary π
Prints the statistics for the dictionary hashtable sizes and bucket length. Impact: Medium
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
options:
verboseβ (Optional) dumps the content of each dictionary entry for all class loaders. (BOOLEAN,false)
VM.uptime [options] β±οΈ
Prints the VM uptime. Impact: Low
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
options:
-dateβ (Optional) adds a prefix with the current date. (BOOLEAN,false)
VM.version π
Prints the JVM version information. Impact: Low
and that's the whole page, bestie β you ate π β¨
This one ships from JDK 27.0.1.0.3, dated 2026 β so yeah, that's the source/version + date energy, no cap ππ¦ Go forth and jcmd responsibly, ily π«Άπ
π¦ where this page comes from
- arch rolling: jdk-openjdk 27.0.1.0.3.u1-1 Β· LicenseRef-Java
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms