1JCMD(1) JDK Commands JCMD(1)
2
3
4
6 jcmd - send diagnostic command requests to a running Java Virtual Ma‐
7 chine (JVM)
8
10 jcmd [pid | main-class] command... | PerfCounter.print | -f filename
11
12 jcmd [-l]
13
14 jcmd -h
15
16 pid When used, the jcmd utility sends the diagnostic command request
17 to the process ID for the Java process.
18
19 main-class
20 When used, the jcmd utility sends the diagnostic command request
21 to all Java processes with the specified name of the main class.
22
23 command
24 The command must be a valid jcmd command for the selected JVM.
25 The list of available commands for jcmd is obtained by running
26 the help command (jcmd pid help) where pid is the process ID for
27 the running Java process. If the pid is 0, commands will be
28 sent to all Java processes. The main class argument will be
29 used to match, either partially or fully, the class used to
30 start Java. If no options are given, it lists the running Java
31 process identifiers with the main class and command-line argu‐
32 ments that were used to launch the process (the same as using
33 -l).
34
35 Perfcounter.print
36 Prints the performance counters exposed by the specified Java
37 process.
38
39 -f filename
40 Reads and executes commands from a specified file, filename.
41
42 -l Displays the list of Java Virtual Machine process identifiers
43 that are not running in a separate docker process along with the
44 main class and command-line arguments that were used to launch
45 the process. If the JVM is in a docker process, you must use
46 tools such as ps to look up the PID.
47
48 Note:
49
50 Using jcmd without arguments is the same as using jcmd -l.
51
52 -h Displays the jcmd utility's command-line help.
53
55 The jcmd utility is used to send diagnostic command requests to the
56 JVM. It must be used on the same machine on which the JVM is running,
57 and have the same effective user and group identifiers that were used
58 to launch the JVM. Each diagnostic command has its own set of argu‐
59 ments. To display the description, syntax, and a list of available ar‐
60 guments for a diagnostic command, use the name of the command as the
61 argument. For example:
62
63 jcmd pid help command
64
65 If arguments contain spaces, then you must surround them with single or
66 double quotation marks (' or "). In addition, you must escape single
67 or double quotation marks with a backslash (\) to prevent the operating
68 system shell from processing quotation marks. Alternatively, you can
69 surround these arguments with single quotation marks and then with dou‐
70 ble quotation marks (or with double quotation marks and then with sin‐
71 gle quotation marks).
72
73 If you specify the process identifier (pid) or the main class
74 (main-class) as the first argument, then the jcmd utility sends the di‐
75 agnostic command request to the Java process with the specified identi‐
76 fier or to all Java processes with the specified name of the main
77 class. You can also send the diagnostic command request to all avail‐
78 able Java processes by specifying 0 as the process identifier.
79
81 The command must be a valid jcmd diagnostic command for the selected
82 JVM. The list of available commands for jcmd is obtained by running
83 the help command (jcmd pid help) where pid is the process ID for a run‐
84 ning Java process. If the pid is 0, commands will be sent to all Java
85 processes. The main class argument will be used to match, either par‐
86 tially or fully, the class used to start Java. If no options are giv‐
87 en, it lists the running Java process identifiers that are not in sepa‐
88 rate docker processes along with the main class and command-line argu‐
89 ments that were used to launch the process (the same as using -l).
90
91 The following commands are available:
92
93 help [options] [arguments]
94 For more information about a specific command.
95
96 arguments:
97
98 • command name: The name of the command for which we want help
99 (STRING, no default value)
100
101 Note:
102
103 The following options must be specified using either key or
104 key=value syntax.
105
106 options:
107
108 • -all: (Optional) Show help for all commands (BOOLEAN, false) .
109
110 Compiler.codecache
111 Prints code cache layout and bounds.
112
113 Impact: Low
114
115 Permission: java.lang.management.ManagementPermission(monitor)
116
117 Compiler.codelist
118 Prints all compiled methods in code cache that are alive.
119
120 Impact: Medium
121
122 Permission: java.lang.management.ManagementPermission(monitor)
123
124 Compiler.perfmap (Linux only)
125 Write map file for Linux perf tool.
126
127 Impact: Low
128
129 Permission: java.lang.management.ManagementPermission(monitor)
130
131 Compiler.queue
132 Prints methods queued for compilation.
133
134 Impact: Low
135
136 Permission: java.lang.management.ManagementPermission(monitor)
137
138 Compiler.directives_add *filename* *arguments*
139 Adds compiler directives from a file.
140
141 Impact: Low
142
143 Permission: java.lang.management.ManagementPermission(monitor)
144
145 arguments:
146
147 filename: The name of the directives file (STRING, no default
148 value)
149
150 Compiler.directives_clear
151 Remove all compiler directives.
152
153 Impact: Low
154
155 Permission: java.lang.management.ManagementPermission(monitor)
156
157 Compiler.directives_print
158 Prints all active compiler directives.
159
160 Impact: Low
161
162 Permission: java.lang.management.ManagementPermission(monitor)
163
164 Compiler.directives_remove
165 Remove latest added compiler directive.
166
167 Impact: Low
168
169 Permission: java.lang.management.ManagementPermission(monitor)
170
171 GC.class_histogram [options]
172 Provides statistics about the Java heap usage.
173
174 Impact: High --- depends on Java heap size and content.
175
176 Permission: java.lang.management.ManagementPermission(monitor)
177
178 Note:
179
180 The options must be specified using either key or key=value syn‐
181 tax.
182
183 options:
184
185 • -all: (Optional) Inspects all objects, including unreachable
186 objects (BOOLEAN, false)
187
188 • -parallel: (Optional) Number of parallel threads to use for
189 heap inspection. 0 (the default) means let the VM determine
190 the number of threads to use. 1 means use one thread (disable
191 parallelism). For any other value the VM will try to use the
192 specified number of threads, but might use fewer. (INT, 0)
193
194 GC.finalizer_info
195 Provides information about the Java finalization queue.
196
197 Impact: Medium
198
199 Permission: java.lang.management.ManagementPermission(monitor)
200
201 GC.heap_dump [options] [arguments]
202 Generates a HPROF format dump of the Java heap.
203
204 Impact: High --- depends on the Java heap size and content. Re‐
205 quest a full GC unless the -all option is specified.
206
207 Permission: java.lang.management.ManagementPermission(monitor)
208
209 Note:
210
211 The following options must be specified using either key or
212 key=value syntax.
213
214 options:
215
216 • -all: (Optional) Dump all objects, including unreachable ob‐
217 jects (BOOLEAN, false)
218
219 • -gz: (Optional) If specified, the heap dump is written in
220 gzipped format using the given compression level. 1 (recom‐
221 mended) is the fastest, 9 the strongest compression. (INT, 1)
222
223 • -overwrite: (Optional) If specified, the dump file will be
224 overwritten if it exists (BOOLEAN, false)
225
226 arguments:
227
228 • filename: The name of the dump file (STRING, no default value)
229
230 GC.heap_info
231 Provides generic Java heap information.
232
233 Impact: Medium
234
235 Permission: java.lang.management.ManagementPermission(monitor)
236
237 GC.run Calls java.lang.System.gc().
238
239 Impact: Medium --- depends on the Java heap size and content.
240
241 GC.run_finalization
242 Calls java.lang.System.runFinalization().
243
244 Impact: Medium --- depends on the Java content.
245
246 JFR.check [options]
247 Show information about a running flight recording
248
249 Impact: Low
250
251 Note:
252
253 The options must be specified using either key or key=value syn‐
254 tax. If no parameters are entered, information for all active
255 recordings is shown.
256
257 options:
258
259 • name: (Optional) Name of the flight recording. (STRING, no
260 default value)
261
262 • verbose: (Optional) Flag for printing the event settings for
263 the recording (BOOLEAN, false)
264
265 JFR.configure [options]
266 Set the parameters for a flight recording
267
268 Impact: Low
269
270 Note:
271
272 The options must be specified using either key or key=value syn‐
273 tax. If no parameters are entered, the current settings are
274 displayed.
275
276 options:
277
278 • globalbuffercount: (Optional) Number of global buffers. This
279 option is a legacy option: change the memorysize parameter to
280 alter the number of global buffers. This value cannot be
281 changed once JFR has been initialized. (STRING, default de‐
282 termined by the value for memorysize)
283
284 • globalbuffersize: (Optional) Size of the global buffers, in
285 bytes. This option is a legacy option: change the memorysize
286 parameter to alter the size of the global buffers. This value
287 cannot be changed once JFR has been initialized. (STRING, de‐
288 fault determined by the value for memorysize)
289
290 • maxchunksize: (Optional) Maximum size of an individual data
291 chunk in bytes if one of the following suffixes is not used:
292 'm' or 'M' for megabytes OR 'g' or 'G' for gigabytes. This
293 value cannot be changed once JFR has been initialized.
294 (STRING, 12M)
295
296 • memorysize: (Optional) Overall memory size, in bytes if one of
297 the following suffixes is not used: 'm' or 'M' for megabytes
298 OR 'g' or 'G' for gigabytes. This value cannot be changed
299 once JFR has been initialized. (STRING, 10M)
300
301 • repositorypath: (Optional) Path to the location where record‐
302 ings are stored until they are written to a permanent file.
303 (STRING, The default location is the temporary directory for
304 the operating system. On Linux operating systems, the tempo‐
305 rary directory is /tmp. On Windwows, the temporary directory
306 is specified by the TMP environment variable.)
307
308 • stackdepth: (Optional) Stack depth for stack traces. Setting
309 this value greater than the default of 64 may cause a perfor‐
310 mance degradation. This value cannot be changed once JFR has
311 been initialized. (LONG, 64)
312
313 • thread_buffer_size: (Optional) Local buffer size for each
314 thread in bytes if one of the following suffixes is not used:
315 'k' or 'K' for kilobytes or 'm' or 'M' for megabytes. Over‐
316 riding this parameter could reduce performance and is not rec‐
317 ommended. This value cannot be changed once JFR has been ini‐
318 tialized. (STRING, 8k)
319
320 • samplethreads: (Optional) Flag for activating thread sampling.
321 (BOOLEAN, true)
322
323 JFR.dump [options]
324 Write data to a file while a flight recording is running
325
326 Impact: Low
327
328 Note:
329
330 The options must be specified using either key or key=value syn‐
331 tax. No options are required. The recording continues to run
332 after the data is written.
333
334 options:
335
336 • begin: (Optional) Specify the time from which recording data
337 will be included in the dump file. The format is specified as
338 local time. (STRING, no default value)
339
340 • end: (Optional) Specify the time to which recording data will
341 be included in the dump file. The format is specified as lo‐
342 cal time. (STRING, no default value)
343
344 Note: For both begin and end, the time must be in a format
345 that can be read by java.time.LocalTime::parse(STRING), ja‐
346 va.time.LocalDateTime::parse(STRING) or java.time.In‐
347 stant::parse(STRING). For example, "13:20:15",
348 "2020-03-17T09:00:00" or "2020-03-17T09:00:00Z".
349
350 Note: begin and end times correspond to the timestamps found
351 within the recorded information in the flight recording data.
352
353 Another option is to use a time relative to the current time
354 that is specified by a negative integer followed by "s", "m"
355 or "h". For example, "-12h", "-15m" or "-30s"
356
357 • filename: (Optional) Name of the file to which the flight
358 recording data is dumped. If no filename is given, a filename
359 is generated from the PID and the current date. The filename
360 may also be a directory in which case, the filename is gener‐
361 ated from the PID and the current date in the specified direc‐
362 tory. (STRING, no default value)
363
364 • maxage: (Optional) Length of time for dumping the flight
365 recording data to a file. (INTEGER followed by 's' for sec‐
366 onds 'm' for minutes or 'h' for hours, no default value)
367
368 • maxsize: (Optional) Maximum size for the amount of data to
369 dump from a flight recording in bytes if one of the following
370 suffixes is not used: 'm' or 'M' for megabytes OR 'g' or 'G'
371 for gigabytes. (STRING, no default value)
372
373 • name: (Optional) Name of the recording. If no name is given,
374 data from all recordings is dumped. (STRING, no default val‐
375 ue)
376
377 • path-to-gc-root: (Optional) Flag for saving the path to
378 garbage collection (GC) roots at the time the recording data
379 is dumped. The path information is useful for finding memory
380 leaks but collecting it can cause the application to pause for
381 a short period of time. Turn on this flag only when you have
382 an application that you suspect has a memory leak. (BOOLEAN,
383 false)
384
385 JFR.start [options]
386 Start a flight recording
387
388 Impact: Low
389
390 Note:
391
392 The options must be specified using either key or key=value syn‐
393 tax. If no parameters are entered, then a recording is started
394 with default values.
395
396 options:
397
398 • delay: (Optional) Length of time to wait before starting to
399 record (INTEGER followed by 's' for seconds 'm' for minutes or
400 'h' for hours, 0s)
401
402 • disk: (Optional) Flag for also writing the data to disk while
403 recording (BOOLEAN, true)
404
405 • dumponexit: (Optional) Flag for writing the recording to disk
406 when the Java Virtual Machine (JVM) shuts down. If set to
407 'true' and no value is given for filename, the recording is
408 written to a file in the directory where the process was
409 started. The file name is a system-generated name that con‐
410 tains the process ID, the recording ID and the current time
411 stamp. (For example: id-1-2019_12_12_10_41.jfr) (BOOLEAN,
412 false)
413
414 • duration: (Optional) Length of time to record. Note that 0s
415 means forever (INTEGER followed by 's' for seconds 'm' for
416 minutes or 'h' for hours, 0s)
417
418 • filename: (Optional) Name of the file to which the flight
419 recording data is written when the recording is stopped. If
420 no filename is given, a filename is generated from the PID and
421 the current date and is placed in the directory where the
422 process was started. The filename may also be a directory in
423 which case, the filename is generated from the PID and the
424 current date in the specified directory. (STRING, no default
425 value)
426
427 • maxage: (Optional) Maximum time to keep the recorded data on
428 disk. This parameter is valid only when the disk parameter is
429 set to true. Note 0s means forever. (INTEGER followed by 's'
430 for seconds 'm' for minutes or 'h' for hours, 0s)
431
432 • maxsize: (Optional) Maximum size of the data to keep on disk
433 in bytes if one of the following suffixes is not used: 'm' or
434 'M' for megabytes OR 'g' or 'G' for gigabytes. This parameter
435 is valid only when the disk parameter is set to 'true'. The
436 value must not be less than the value for the maxchunksize pa‐
437 rameter set with the JFR.configure command. (STRING, 0 (no
438 maximum size))
439
440 • name: (Optional) Name of the recording. If no name is provid‐
441 ed, a name is generated. Make note of the generated name that
442 is shown in the response to the command so that you can use it
443 with other commands. (STRING, system-generated default name)
444
445 • path-to-gc-root: (Optional) Flag for saving the path to
446 garbage collection (GC) roots at the end of a recording. The
447 path information is useful for finding memory leaks but col‐
448 lecting it is time consuming. Turn on this flag only when you
449 have an application that you suspect has a memory leak. If
450 the settings parameter is set to 'profile', then the informa‐
451 tion collected includes the stack trace from where the poten‐
452 tial leaking object was allocated. (BOOLEAN, false)
453
454 • settings: (Optional) Name of the settings file that identifies
455 which events to record. To specify more than one file, sepa‐
456 rate the names with a comma (','). Include the path if the
457 file is not in JAVA-HOME/lib/jfr. The following profiles are
458 included with the JDK in the JAVA-HOME/lib/jfr directory: 'de‐
459 fault.jfc': collects a predefined set of information with low
460 overhead, so it has minimal impact on performance and can be
461 used with recordings that run continuously; 'profile.jfc':
462 Provides more data than the 'default.jfc' profile, but with
463 more overhead and impact on performance. Use this configura‐
464 tion for short periods of time when more information is need‐
465 ed. Use none to start a recording without a predefined con‐
466 figuration file. (STRING, JAVA-HOME/lib/jfr/default.jfc)
467
468 Event settings and .jfc options can be specified using the fol‐
469 lowing syntax:
470
471 • option: (Optional) Specifies the option value to modify. To
472 list available options, use the JAVA_HOME/bin/jfr tool.
473
474 • event-setting: (Optional) Specifies the event setting value to
475 modify. Use the form: <event-name>#<setting-name>=<value> To
476 add a new event setting, prefix the event name with '+'.
477
478 You can specify values for multiple event settings and .jfc op‐
479 tions by separating them with a whitespace. In case of a con‐
480 flict between a parameter and a .jfc option, the parameter will
481 take precedence. The whitespace delimiter can be omitted for
482 timespan values, i.e. 20ms. For more information about the
483 settings syntax, see Javadoc of the jdk.jfr package.
484
485 JFR.stop [options]
486 Stop a flight recording
487
488 Impact: Low
489
490 Note:
491
492 The options must be specified using either key or key=value syn‐
493 tax. If no parameters are entered, then no recording is
494 stopped.
495
496 options:
497
498 • filename: (Optional) Name of the file to which the recording
499 is written when the recording is stopped. If no path is pro‐
500 vided, the data from the recording is discarded. (STRING, no
501 default value)
502
503 • name: (Optional) Name of the recording (STRING, no default
504 value)
505
506 JVMTI.agent_load [arguments]
507 Loads JVMTI native agent.
508
509 Impact: Low
510
511 Permission: java.lang.management.ManagementPermission(control)
512
513 arguments:
514
515 • library path: Absolute path of the JVMTI agent to load.
516 (STRING, no default value)
517
518 • agent option: (Optional) Option string to pass the agent.
519 (STRING, no default value)
520
521 JVMTI.data_dump
522 Signals the JVM to do a data-dump request for JVMTI.
523
524 Impact: High
525
526 Permission: java.lang.management.ManagementPermission(monitor)
527
528 ManagementAgent.start [options]
529 Starts remote management agent.
530
531 Impact: Low --- no impact
532
533 Note:
534
535 The following options must be specified using either key or
536 key=value syntax.
537
538 options:
539
540 • config.file: (Optional) Sets com.sun.management.config.file
541 (STRING, no default value)
542
543 • jmxremote.host: (Optional) Sets com.sun.management.jmxre‐
544 mote.host (STRING, no default value)
545
546 • jmxremote.port: (Optional) Sets com.sun.management.jmxre‐
547 mote.port (STRING, no default value)
548
549 • jmxremote.rmi.port: (Optional) Sets com.sun.management.jmxre‐
550 mote.rmi.port (STRING, no default value)
551
552 • jmxremote.ssl: (Optional) Sets com.sun.management.jmxre‐
553 mote.ssl (STRING, no default value)
554
555 • jmxremote.registry.ssl: (Optional) Sets com.sun.manage‐
556 ment.jmxremote.registry.ssl (STRING, no default value)
557
558 • jmxremote.authenticate: (Optional) Sets com.sun.manage‐
559 ment.jmxremote.authenticate (STRING, no default value)
560
561 • jmxremote.password.file: (Optional) Sets com.sun.manage‐
562 ment.jmxremote.password.file (STRING, no default value)
563
564 • jmxremote.access.file: (Optional) Sets com.sun.manage‐
565 ment.jmxremote.acce ss.file (STRING, no default value)
566
567 • jmxremote.login.config: (Optional) Sets com.sun.manage‐
568 ment.jmxremote.log in.config (STRING, no default value)
569
570 • jmxremote.ssl.enabled.cipher.suites: (Optional) Sets
571 com.sun.management.
572
573 • jmxremote.ssl.enabled.cipher.suite: (STRING, no default value)
574
575 • jmxremote.ssl.enabled.protocols: (Optional) Sets com.sun.man‐
576 agement.jmxr emote.ssl.enabled.protocols (STRING, no default
577 value)
578
579 • jmxremote.ssl.need.client.auth: (Optional) Sets com.sun.man‐
580 agement.jmxre mote.need.client.auth (STRING, no default value)
581
582 • jmxremote.ssl.config.file: (Optional) Sets com.sun.manage‐
583 ment.jmxremote. ssl_config_file (STRING, no default value)
584
585 • jmxremote.autodiscovery: (Optional) Sets com.sun.manage‐
586 ment.jmxremote.au todiscovery (STRING, no default value)
587
588 • jdp.port: (Optional) Sets com.sun.management.jdp.port (INT, no
589 default value)
590
591 • jdp.address: (Optional) Sets com.sun.management.jdp.address
592 (STRING, no default value)
593
594 • jdp.source_addr: (Optional) Sets com.sun.manage‐
595 ment.jdp.source_addr (STRING, no default value)
596
597 • jdp.ttl: (Optional) Sets com.sun.management.jdp.ttl (INT, no
598 default value)
599
600 • jdp.pause: (Optional) Sets com.sun.management.jdp.pause (INT,
601 no default value)
602
603 • jdp.name: (Optional) Sets com.sun.management.jdp.name (STRING,
604 no default value)
605
606 ManagementAgent.start_local
607 Starts the local management agent.
608
609 Impact: Low --- no impact
610
611 ManagementAgent.status
612 Print the management agent status.
613
614 Impact: Low --- no impact
615
616 Permission: java.lang.management.ManagementPermission(monitor)
617
618 ManagementAgent.stop
619 Stops the remote management agent.
620
621 Impact: Low --- no impact
622
623 System.trim_native_heap (Linux only)
624 Attempts to free up memory by trimming the C-heap.
625
626 Impact: Low
627
628 Permission: java.lang.management.ManagementPermission(control)
629
630 Thread.print [options]
631 Prints all threads with stacktraces.
632
633 Impact: Medium --- depends on the number of threads.
634
635 Permission: java.lang.management.ManagementPermission(monitor)
636
637 Note:
638
639 The following options must be specified using either key or
640 key=value syntax.
641
642 options:
643
644 • -e: (Optional) Print extended thread information (BOOLEAN,
645 false)
646
647 • -l: (Optional) Prints java.util.concurrent locks (BOOLEAN,
648 false)
649
650 VM.cds [arguments]
651 Dumps a static or dynamic shared archive that includes all cur‐
652 rently loaded classes.
653
654 Impact: Medium --- pause time depends on number of loaded class‐
655 es
656
657 Permission: java.lang.management.ManagementPermission(monitor)
658
659 arguments:
660
661 • subcmd: must be either static_dump or dynamic_dump (STRING, no
662 default value)
663
664 • filename: (Optional) Name of the shared archive to be dumped
665 (STRING, no default value)
666
667 If filename is not specified, a default file name is chosen us‐
668 ing the pid of the target JVM process. For example, ja‐
669 va_pid1234_static.jsa, java_pid5678_dynamic.jsa, etc.
670
671 If filename is not specified as an absolute path, the archive
672 file is created in a directory relative to the current directory
673 of the target JVM process.
674
675 If dynamic_dump is specified, the target JVM must be started
676 with the JVM option -XX:+RecordDynamicDumpInfo.
677
678 VM.classloaders [options]
679 Prints classloader hierarchy.
680
681 Impact: Medium --- Depends on number of class loaders and class‐
682 es loaded.
683
684 Permission: java.lang.management.ManagementPermission(monitor)
685
686 The following options must be specified using either key or
687 key=value syntax.
688
689 options:
690
691 • show-classes: (Optional) Print loaded classes. (BOOLEAN,
692 false)
693
694 • verbose: (Optional) Print detailed information. (BOOLEAN,
695 false)
696
697 • fold: (Optional) Show loaders of the same name and class as
698 one. (BOOLEAN, true)
699
700 VM.classloader_stats
701 Prints statistics about all ClassLoaders.
702
703 Impact: Low
704
705 Permission: java.lang.management.ManagementPermission(monitor)
706
707 VM.class_hierarchy [options] [arguments]
708 Prints a list of all loaded classes, indented to show the class
709 hierarchy. The name of each class is followed by the ClassLoad‐
710 erData* of its ClassLoader, or "null" if it is loaded by the
711 bootstrap class loader.
712
713 Impact: Medium --- depends on the number of loaded classes.
714
715 Permission: java.lang.management.ManagementPermission(monitor)
716
717 Note:
718
719 The following options must be specified using either key or
720 key=value syntax.
721
722 options:
723
724 • -i: (Optional) Inherited interfaces should be printed. (BOOL‐
725 EAN, false)
726
727 • -s: (Optional) If a classname is specified, print its sub‐
728 classes in addition to its superclasses. Without this option
729 only the superclasses will be printed. (BOOLEAN, false)
730
731 arguments:
732
733 • classname: (Optional) The name of the class whose hierarchy
734 should be printed. If not specified, all class hierarchies
735 are printed. (STRING, no default value)
736
737 VM.command_line
738 Prints the command line used to start this VM instance.
739
740 Impact: Low
741
742 Permission: java.lang.management.ManagementPermission(monitor)
743
744 VM.dynlibs
745 Prints the loaded dynamic libraries.
746
747 Impact: Low
748
749 Permission: java.lang.management.ManagementPermission(monitor)
750
751 VM.events [options]
752 Print VM event logs
753
754 Impact: Low --- Depends on event log size.
755
756 Permission: java.lang.management.ManagementPermission(monitor)
757
758 options:
759
760 Note:
761
762 The following options must be specified using either key or
763 key=value syntax.
764
765 • log: (Optional) Name of log to be printed. If omitted, all
766 logs are printed. (STRING, no default value)
767
768 • max: (Optional) Maximum number of events to be printed (newest
769 first). If omitted, all events are printed. (STRING, no de‐
770 fault value)
771
772 VM.info
773 Prints information about the JVM environment and status.
774
775 Impact: Low
776
777 Permission: java.lang.management.ManagementPermission(monitor)
778
779 VM.log [options]
780 Lists current log configuration, enables/disables/configures a
781 log output, or rotates all logs.
782
783 Impact: Low
784
785 Permission: java.lang.management.ManagementPermission(control)
786
787 options:
788
789 Note:
790
791 The following options must be specified using either key or
792 key=value syntax.
793
794 • output: (Optional) The name or index (#) of output to config‐
795 ure. (STRING, no default value)
796
797 • output_options: (Optional) Options for the output. (STRING,
798 no default value)
799
800 • what: (Optional) Configures what tags to log. (STRING, no de‐
801 fault value )
802
803 • decorators: (Optional) Configures which decorators to use.
804 Use 'none' or an empty value to remove all. (STRING, no de‐
805 fault value)
806
807 • disable: (Optional) Turns off all logging and clears the log
808 configuration. (BOOLEAN, no default value)
809
810 • list: (Optional) Lists current log configuration. (BOOLEAN,
811 no default value)
812
813 • rotate: (Optional) Rotates all logs. (BOOLEAN, no default
814 value)
815
816 VM.flags [options]
817 Prints the VM flag options and their current values.
818
819 Impact: Low
820
821 Permission: java.lang.management.ManagementPermission(monitor)
822
823 Note:
824
825 The following options must be specified using either key or
826 key=value syntax.
827
828 options:
829
830 • -all: (Optional) Prints all flags supported by the VM (BOOL‐
831 EAN, false).
832
833 VM.metaspace [options]
834 Prints the statistics for the metaspace
835
836 Impact: Medium --- Depends on number of classes loaded.
837
838 Permission: java.lang.management.ManagementPermission(monitor)
839
840 Note:
841
842 The following options must be specified using either key or
843 key=value syntax.
844
845 options:
846
847 • basic: (Optional) Prints a basic summary (does not need a
848 safepoint). (BOOLEAN, false)
849
850 • show-loaders: (Optional) Shows usage by class loader. (BOOL‐
851 EAN, false)
852
853 • show-classes: (Optional) If show-loaders is set, shows loaded
854 classes for each loader. (BOOLEAN, false)
855
856 • by-chunktype: (Optional) Break down numbers by chunk type.
857 (BOOLEAN, false)
858
859 • by-spacetype: (Optional) Break down numbers by loader type.
860 (BOOLEAN, false)
861
862 • vslist: (Optional) Shows details about the underlying virtual
863 space. (BOOLEAN, false)
864
865 • scale: (Optional) Memory usage in which to scale. Valid val‐
866 ues are: 1, KB, MB or GB (fixed scale) or "dynamic" for a dy‐
867 namically chosen scale. (STRING, dynamic)
868
869 VM.native_memory [options]
870 Prints native memory usage
871
872 Impact: Medium
873
874 Permission: java.lang.management.ManagementPermission(monitor)
875
876 Note:
877
878 The following options must be specified using either key or
879 key=value syntax.
880
881 options:
882
883 • summary: (Optional) Requests runtime to report current memory
884 summary, which includes total reserved and committed memory,
885 along with memory usage summary by each subsystem. (BOOLEAN,
886 false)
887
888 • detail: (Optional) Requests runtime to report memory alloca‐
889 tion >= 1K by each callsite. (BOOLEAN, false)
890
891 • baseline: (Optional) Requests runtime to baseline current mem‐
892 ory usage, so it can be compared against in later time.
893 (BOOLEAN, false)
894
895 • summary.diff: (Optional) Requests runtime to report memory
896 summary comparison against previous baseline. (BOOLEAN,
897 false)
898
899 • detail.diff: (Optional) Requests runtime to report memory de‐
900 tail comparison against previous baseline, which shows the
901 memory allocation activities at different callsites. (BOOL‐
902 EAN, false)
903
904 • statistics: (Optional) Prints tracker statistics for tuning
905 purpose. (BOOLEAN, false)
906
907 • scale: (Optional) Memory usage in which scale, KB, MB or GB
908 (STRING, KB)
909
910 VM.print_touched_methods
911 Prints all methods that have ever been touched during the life‐
912 time of this JVM.
913
914 Impact: Medium --- depends on Java content.
915
916 VM.set_flag [arguments]
917 Sets the VM flag option by using the provided value.
918
919 Impact: Low
920
921 Permission: java.lang.management.ManagementPermission(control)
922
923 arguments:
924
925 • flag name: The name of the flag that you want to set (STRING,
926 no default value)
927
928 • string value: (Optional) The value that you want to set
929 (STRING, no default value)
930
931 VM.stringtable [options]
932 Dumps the string table.
933
934 Impact: Medium --- depends on the Java content.
935
936 Permission: java.lang.management.ManagementPermission(monitor)
937
938 Note:
939
940 The following options must be specified using either key or
941 key=value syntax.
942
943 options:
944
945 • -verbose: (Optional) Dumps the content of each string in the
946 table (BOOLEAN, false)
947
948 VM.symboltable [options]
949 Dumps the symbol table.
950
951 Impact: Medium --- depends on the Java content.
952
953 Permission: java.lang.management.ManagementPermission(monitor)
954
955 Note:
956
957 The following options must be specified using either key or
958 key=value syntax).
959
960 options:
961
962 • -verbose: (Optional) Dumps the content of each symbol in the
963 table (BOOLEAN, false)
964
965 VM.systemdictionary
966 Prints the statistics for dictionary hashtable sizes and bucket
967 length.
968
969 Impact: Medium
970
971 Permission: java.lang.management.ManagementPermission(monitor)
972
973 Note:
974
975 The following options must be specified using either key or
976 key=value syntax.
977
978 options:
979
980 • verbose: (Optional) Dump the content of each dictionary entry
981 for all class loaders (BOOLEAN, false) .
982
983 VM.system_properties
984 Prints the system properties.
985
986 Impact: Low
987
988 Permission: java.util.PropertyPermission(*, read)
989
990 VM.uptime [options]
991 Prints the VM uptime.
992
993 Impact: Low
994
995 Note:
996
997 The following options must be specified using either key or
998 key=value syntax.
999
1000 options:
1001
1002 • -date: (Optional) Adds a prefix with the current date (BOOL‐
1003 EAN, false)
1004
1005 VM.version
1006 Prints JVM version information.
1007
1008 Impact: Low
1009
1010 Permission: java.util.PropertyPermission(java.vm.version, read)
1011
1012
1013
1014JDK 19 2022 JCMD(1)