JCMD(1)
π jcmd π
okay so bestie, welcome to JCMD(1) β straight out of the JDK Commands manual, and it's kind of the main character of JVM diagnostics ngl π
πΈ NAME πΈ
jcmd β send 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 you use it,jcmdsends the diagnostic command request to the process ID for the Java process.main-classβ when you use it,jcmdsends the diagnostic command request to all Java processes with the specified name of the main class.commandβ has to be a validjcmdcommand for the selected JVM. You get the list of available commands forjcmdby running thehelpcommand (jcmd pid help) wherepidis the process ID for the running Java process. If thepidis0, commands will be sent to all Java processes. The main class argument gets used to match, either partially or fully, the class used to start Java. If no options are given, it lists the running Java process identifiers with the main class and command-line arguments that were used to launch the process (the same as using-l). πPerfcounter.printβ prints the performance counters exposed by the specified Java process.-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. π
Note: usingjcmdwithout arguments is the same as usingjcmd -l. iykyk π
-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 has to have the same effective user and group identifiers that were used to launch the JVM. Like, it's not gonna slide through a wall for you, no cap πͺβ¨
Each diagnostic command has its own set of arguments. To display the description, syntax, and a list of available arguments for a diagnostic command, use the name of the command as the argument. For example:
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). The way the shell is lowkey gonna fight you if you don't π
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).
The following commands are available, bestie β buckle up π’
π 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) .
π Compiler.CodeHeap_Analytics [function] [granularity]
Print CodeHeap analytics π¬
Impact: Low: depends on code heap size and content. Holds CodeCache_lock during the 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: 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)-sβ (Optional) minimum memory size (MEMORY SIZE,0)
π Compiler.perfmap (Linux only)
Write map file for Linux perf tool. π§
Impact: Low
π 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. π₯
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: Medium
π GC.heap_dump [options] [arguments]
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.
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 (STRING, 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)
π 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) the overall memory size, in bytes β unless you're using one of these lil suffixes:'m'or'M'for megabytes, OR'g'or'G'for gigabytes. πΎ Heads up bestie: this value cannot be changed once JFR has been initialized, so pick your fave and commit. (STRING,10M)repositorypathβ (optional) the path to the location where recordings hang out until they get written to a permanent file. (STRING, default location is the temporary directory for the operating system. On Linux, that temporary directory is/tmp. On Windows, the temporary directory is whatever theTMPenvironment variable says.) ποΈpreserve-repository={true|false}β says whether files stored in the disk repository should be kept after the JVM has exited. If it'sfalse, the files get deleted. By default, this parameter is disabled. (So likeβ¦ off. Nothing survives. π)stackdepthβ (optional) the stack depth for stack traces. Setting this higher than the default of64may cause a performance degradation, so don't go feral with it. 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, 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, ngl. 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, bestie: the options must be specified using eitherkeyorkey=valuesyntax. No options are required. The recording keeps running after the data is written β it's giving "screenshot, not shutdown". π
options:
beginβ (optional) 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) 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, 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. (STRING, 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-rootβ (optional) the flag for saving the path to garbage collection (GC) roots at the time the recording data is dumped. This path info is genuinely useful for finding memory leaks, but collecting it can cause the application to pause for a short period of time β so turn on this flag only when you have an application you suspect has a memory leak. (BOOLEAN,false)
πΈ JFR.start [options]
Start a flight recording. π«β¨
Impact: Low
Note, bestie: the options must be specified using eitherkeyorkey=valuesyntax. If no parameters are entered, then a recording is started with default values. Easy.
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) the flag for also writing the data to disk while recording. (BOOLEAN,true)dumponexitβ (optional) the 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. (STRING, 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's shown in the response to the command, so you can use it with other commands β like, literally write it down bestie, you'll need it. (STRING, system-generated default name) βοΈpath-to-gc-rootβ (optional) the 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 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 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. πβ¨
Impact: Low
Note, bestie: the options must be specified using eitherkeyorkey=valuesyntax. If no parameters are entered, then no recording is stopped. (Yes, it's a no-op. It's giving "boundaries". π )
options:
filenameβ (optional) the name of the file to which the recording is written 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 β so like, say goodbye to it forever. π (STRING, no default value)nameβ (optional) the name of the recording. (STRING, no default value)
π JVMTI.agent_load [arguments]
Loads the JVMTI native agent. π§
Impact: Low
arguments:
library pathβ the absolute path of the JVMTI agent to load. (STRING, no default value) π- agent option β (Optional) the option string you pass along to the agent. (
STRING, no default value) π«Ά
JVMTI.data_dump
Tell the JVM to do a data-dump request for JVMTI. That's it, that's the whole job β¨
Impact: High π₯
ManagementAgent.start [options]
Starts the remote management agent. Bestie's waking up the remote vibes π
Impact: Low --- no impact
Note: the following options must be specified using eitherkeyorkey=valuesyntax. No improvising, okay? π
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. Same energy, smaller radius π
Impact: Low --- no impact
ManagementAgent.status
Prints the management agent status. A little vibe check for your agent π
Impact: Low --- no impact
ManagementAgent.stop
Stops the remote management agent. It's giving goodbye π
Impact: Low --- no impact
System.dump_map [options] (Linux only) π§
Dumps an annotated process memory map to an output file. A whole map, annotated, so you can actually read it π
Impact: Low
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
options:
-Hβ (Optional) human readable format (BOOLEAN,false)-Fβ (Optional) file path (STRING,"vm_memory_map_.txt")
System.map [options] (Linux only) π§
Prints an annotated process memory map of the VM process β like dump_map but it just goes straight to your screen, no file middleman β¨
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 it doesn't work out, it outputs "Error: " and a reason. Very "we tried, here's why it flopped" of it π
Impact: Low
System.trim_native_heap (Linux only) π§
Attempts to free up memory by trimming the C-heap. A little spa day for your heap πΈ
Impact: Low
Thread.dump_to_file [options] filepath
Dumps threads, with stack traces, to a file in plain text or JSON format. Receipts! In a file! π
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 to the output file (
STRING, no default value)
Thread.print [options]
Prints all threads with stacktraces. All of them. Every single one π«Ά
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)
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 either
static_dumpordynamic_dump(STRING, no default value) - filename β (Optional) name of the shared archive to be dumped (
STRING, no default value)
If filename is not specified, a default file name is chosen using the pid of the target JVM process. For example, java_pid1234_static.jsa, java_pid5678_dynamic.jsa, etc. Cute little auto-naming moment π
If filename is not specified as an absolute path, the archive file is created in a directory relative to the current directory of the target JVM process.
Ifdynamic_dumpis specified, the target JVM must be started with the JVM option-XX:+RecordDynamicDumpInfo. Non-negotiable, bestie π¨
VM.class_hierarchy [options] [arguments]
Prints a list of all loaded classes, indented to show the class hierarchy. The name of each class is followed by the ClassLoaderData* of its ClassLoader, or "null" if it's loaded by the bootstrap class loader. Family tree reveal, class edition π³
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 π
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 statistics about all ClassLoaders. Numbers everywhere, slay π
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 either key or key=value syntax.
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. The origin story π«Ά
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) name of log to be printed. If omitted, all logs are printed (STRING, no default value)maxβ (Optional) maximum number of events to be printed (newest first). If omitted, all events are printed (STRING, no default value)
VM.flags [options]
Prints the VM flag options and their current values π©
Impact: Low
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
options:
-allβ (Optional) prints all flags supported by the VM (BOOLEAN,false)
VM.info
Prints information about the JVM environment and status. The whole 411 on your JVM π
Impact: Low
VM.log [options]
Lists current log configuration, enables/disables/configures a log output, or rotates all logs. It does the most, honestly π
Impact: Low
options:
Note: the following options must be specified using eitherkeyorkey=valuesyntax.
outputβ (Optional) the name or index (#) of output to configure (STRING, no default value)output_optionsβ (Optional) options for the output (STRING, no default value)whatβ (Optional) configures what tags to log (STRING, no default value )decoratorsβ (Optional) configures which decorators to use. Use'none'or an empty value to remove all (STRING, no default value)disableβ turns off all logging and clears the log configuration. (BOOLEAN, no default value) π«Άlistβ lists the current log configuration. (BOOLEAN, no default value) πrotateβ rotates all logs. (BOOLEAN, no default value) π
VM.metaspace [options] π§ β¨
Prints the statistics for the metaspace. It's giving memory-nerd main character energy.
Impact: Medium --- Depends on 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 (does not need a safepoint). (BOOLEAN,false) π±show-loadersβ (Optional) Shows usage by class loader. (BOOLEAN,false) π§Έshow-classesβ (Optional) Ifshow-loadersis set, shows loaded classes for each loader. (BOOLEAN,false) πby-chunktypeβ (Optional) Break down numbers by chunk type. (BOOLEAN,false) π§©by-spacetypeβ (Optional) Break down numbers by loader type. (BOOLEAN,false) π·οΈvslistβ (Optional) Shows details about the underlying virtual space. (BOOLEAN,false) πΊοΈchunkfreelistβ (Optional) Shows details about global chunk free lists (ChunkManager). (BOOLEAN,false) π§Ίscaleβ (Optional) Memory usage in which to scale. Valid values are:1,KB,MBorGB(fixed scale) or"dynamic"for a dynamically chosen scale. (STRING,dynamic) π
VM.native_memory [options] π§¬π
Print native memory usage. Lowkey essential when you're snooping on memory.
Impact: Medium
Note:
The following options must be specified using either key or key=value syntax.
options:
summaryβ (Optional) Requests runtime to report current memory summary, which includes total reserved and committed memory, along with memory usage summary by each subsystem. (BOOLEAN,false) πdetailβ (Optional) Requests runtime to report memory allocation>= 1Kby each callsite. (BOOLEAN,false) πbaselineβ (Optional) Requests runtime to baseline current memory usage, so it can be compared against in later time. (BOOLEAN,false) πsummary.diffβ (Optional) Requests runtime to report memory summary comparison against previous baseline. (BOOLEAN,false) πͺdetail.diffβ (Optional) Requests runtime to report memory detail comparison against previous baseline, which shows the memory allocation activities at different callsites. (BOOLEAN,false) π§Ύstatisticsβ (Optional) Prints tracker statistics for tuning purpose. (BOOLEAN,false) πscaleβ (Optional) Memory usage in which scale,KB,MBorGB(STRING,KB) βοΈ
VM.set_flag [arguments] π©π
Sets VM flag option using the provided value. Queen behavior: changing flags on purpose.
Impact: Low
arguments:
- flag name β The name of the flag that you want to set (
STRING, no default value) π·οΈ - string value β (Optional) The value that you want to set (
STRING, no default value) βοΈ
VM.stringtable [options] π§΅πΈ
Dump string 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,false) π€
VM.symboltable [options] π£π¦
Dump symbol 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,false) π‘
VM.system_properties π π
Print system properties. Little peek behind the curtain, no cap.
Impact: Low
VM.systemdictionary πβ¨
Prints the statistics for dictionary hashtable sizes and bucket length.
Impact: Medium
Note:
The following options must be specified using either key or key=value syntax.
options:
verboseβ (Optional) Dump the content of each dictionary entry for all class loaders (BOOLEAN,false) . ποΈ
VM.uptime [options] β±οΈπ
Print VM uptime.
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 (BOOLEAN,false) π
VM.version πβ
Print JVM version information.
Impact: Low
This iconic page is JDK 22, dated 2024, and it's JCMD(1) β periodt bestie π
β¨π
π¦ where this page comes from
- opensuse-leap 16.0: java-22-openjdk-devel 22.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- opensuse-leap 16.0: java-22-openjdk-devel 22.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- opensuse-leap 16.0: java-22-openjdk-devel 22.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- opensuse-leap 16.0: java-22-openjdk-devel 22.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms