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 initalized. (STRING, default deter‐
282 mined 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 initalized. (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 Dump a static or dynamic shared archive including all shareable
652 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: static_dump | dynamic_dump (STRING, no default value)
662
663 • filename: (Optional) Name of the shared archive to be dumped
664 (STRING, no default value)
665
666 VM.classloaders [options]
667 Prints classloader hierarchy.
668
669 Impact: Medium --- Depends on number of class loaders and class‐
670 es loaded.
671
672 Permission: java.lang.management.ManagementPermission(monitor)
673
674 The following options must be specified using either key or
675 key=value syntax.
676
677 options:
678
679 • show-classes: (Optional) Print loaded classes. (BOOLEAN,
680 false)
681
682 • verbose: (Optional) Print detailed information. (BOOLEAN,
683 false)
684
685 • fold: (Optional) Show loaders of the same name and class as
686 one. (BOOLEAN, true)
687
688 VM.classloader_stats
689 Prints statistics about all ClassLoaders.
690
691 Impact: Low
692
693 Permission: java.lang.management.ManagementPermission(monitor)
694
695 VM.class_hierarchy [options] [arguments]
696 Prints a list of all loaded classes, indented to show the class
697 hierarchy. The name of each class is followed by the ClassLoad‐
698 erData* of its ClassLoader, or "null" if it is loaded by the
699 bootstrap class loader.
700
701 Impact: Medium --- depends on the number of loaded classes.
702
703 Permission: java.lang.management.ManagementPermission(monitor)
704
705 Note:
706
707 The following options must be specified using either key or
708 key=value syntax.
709
710 options:
711
712 • -i: (Optional) Inherited interfaces should be printed. (BOOL‐
713 EAN, false)
714
715 • -s: (Optional) If a class name is specified, it prints the
716 subclasses. If the class name is not specified, only the su‐
717 perclasses are printed. (BOOLEAN, false)
718
719 arguments:
720
721 • classname: (Optional) The name of the class whose hierarchy
722 should be printed. If not specified, all class hierarchies
723 are printed. (STRING, no default value)
724
725 VM.command_line
726 Prints the command line used to start this VM instance.
727
728 Impact: Low
729
730 Permission: java.lang.management.ManagementPermission(monitor)
731
732 VM.dynlibs
733 Prints the loaded dynamic libraries.
734
735 Impact: Low
736
737 Permission: java.lang.management.ManagementPermission(monitor)
738
739 VM.events [options]
740 Print VM event logs
741
742 Impact: Low --- Depends on event log size.
743
744 Permission: java.lang.management.ManagementPermission(monitor)
745
746 options:
747
748 Note:
749
750 The following options must be specified using either key or
751 key=value syntax.
752
753 • log: (Optional) Name of log to be printed. If omitted, all
754 logs are printed. (STRING, no default value)
755
756 • max: (Optional) Maximum number of events to be printed (newest
757 first). If omitted, all events are printed. (STRING, no de‐
758 fault value)
759
760 VM.info
761 Prints information about the JVM environment and status.
762
763 Impact: Low
764
765 Permission: java.lang.management.ManagementPermission(monitor)
766
767 VM.log [options]
768 Lists current log configuration, enables/disables/configures a
769 log output, or rotates all logs.
770
771 Impact: Low
772
773 Permission: java.lang.management.ManagementPermission(control)
774
775 options:
776
777 Note:
778
779 The following options must be specified using either key or
780 key=value syntax.
781
782 • output: (Optional) The name or index (#) of output to config‐
783 ure. (STRING, no default value)
784
785 • output_options: (Optional) Options for the output. (STRING,
786 no default value)
787
788 • what: (Optional) Configures what tags to log. (STRING, no de‐
789 fault value )
790
791 • decorators: (Optional) Configures which decorators to use.
792 Use 'none' or an empty value to remove all. (STRING, no de‐
793 fault value)
794
795 • disable: (Optional) Turns off all logging and clears the log
796 configuration. (BOOLEAN, no default value)
797
798 • list: (Optional) Lists current log configuration. (BOOLEAN,
799 no default value)
800
801 • rotate: (Optional) Rotates all logs. (BOOLEAN, no default
802 value)
803
804 VM.flags [options]
805 Prints the VM flag options and their current values.
806
807 Impact: Low
808
809 Permission: java.lang.management.ManagementPermission(monitor)
810
811 Note:
812
813 The following options must be specified using either key or
814 key=value syntax.
815
816 options:
817
818 • -all: (Optional) Prints all flags supported by the VM (BOOL‐
819 EAN, false).
820
821 VM.metaspace [options]
822 Prints the statistics for the metaspace
823
824 Impact: Medium --- Depends on number of classes loaded.
825
826 Permission: java.lang.management.ManagementPermission(monitor)
827
828 Note:
829
830 The following options must be specified using either key or
831 key=value syntax.
832
833 options:
834
835 • basic: (Optional) Prints a basic summary (does not need a
836 safepoint). (BOOLEAN, false)
837
838 • show-loaders: (Optional) Shows usage by class loader. (BOOL‐
839 EAN, false)
840
841 • show-classes: (Optional) If show-loaders is set, shows loaded
842 classes for each loader. (BOOLEAN, false)
843
844 • by-chunktype: (Optional) Break down numbers by chunk type.
845 (BOOLEAN, false)
846
847 • by-spacetype: (Optional) Break down numbers by loader type.
848 (BOOLEAN, false)
849
850 • vslist: (Optional) Shows details about the underlying virtual
851 space. (BOOLEAN, false)
852
853 • scale: (Optional) Memory usage in which to scale. Valid val‐
854 ues are: 1, KB, MB or GB (fixed scale) or "dynamic" for a dy‐
855 namically chosen scale. (STRING, dynamic)
856
857 VM.native_memory [options]
858 Prints native memory usage
859
860 Impact: Medium
861
862 Permission: java.lang.management.ManagementPermission(monitor)
863
864 Note:
865
866 The following options must be specified using either key or
867 key=value syntax.
868
869 options:
870
871 • summary: (Optional) Requests runtime to report current memory
872 summary, which includes total reserved and committed memory,
873 along with memory usage summary by each subsystem. (BOOLEAN,
874 false)
875
876 • detail: (Optional) Requests runtime to report memory alloca‐
877 tion >= 1K by each callsite. (BOOLEAN, false)
878
879 • baseline: (Optional) Requests runtime to baseline current mem‐
880 ory usage, so it can be compared against in later time.
881 (BOOLEAN, false)
882
883 • summary.diff: (Optional) Requests runtime to report memory
884 summary comparison against previous baseline. (BOOLEAN,
885 false)
886
887 • detail.diff: (Optional) Requests runtime to report memory de‐
888 tail comparison against previous baseline, which shows the
889 memory allocation activities at different callsites. (BOOL‐
890 EAN, false)
891
892 • statistics: (Optional) Prints tracker statistics for tuning
893 purpose. (BOOLEAN, false)
894
895 • scale: (Optional) Memory usage in which scale, KB, MB or GB
896 (STRING, KB)
897
898 VM.print_touched_methods
899 Prints all methods that have ever been touched during the life‐
900 time of this JVM.
901
902 Impact: Medium --- depends on Java content.
903
904 VM.set_flag [arguments]
905 Sets the VM flag option by using the provided value.
906
907 Impact: Low
908
909 Permission: java.lang.management.ManagementPermission(control)
910
911 arguments:
912
913 • flag name: The name of the flag that you want to set (STRING,
914 no default value)
915
916 • string value: (Optional) The value that you want to set
917 (STRING, no default value)
918
919 VM.stringtable [options]
920 Dumps the string table.
921
922 Impact: Medium --- depends on the Java content.
923
924 Permission: java.lang.management.ManagementPermission(monitor)
925
926 Note:
927
928 The following options must be specified using either key or
929 key=value syntax.
930
931 options:
932
933 • -verbose: (Optional) Dumps the content of each string in the
934 table (BOOLEAN, false)
935
936 VM.symboltable [options]
937 Dumps the symbol table.
938
939 Impact: Medium --- depends on the Java content.
940
941 Permission: java.lang.management.ManagementPermission(monitor)
942
943 Note:
944
945 The following options must be specified using either key or
946 key=value syntax).
947
948 options:
949
950 • -verbose: (Optional) Dumps the content of each symbol in the
951 table (BOOLEAN, false)
952
953 VM.systemdictionary
954 Prints the statistics for dictionary hashtable sizes and bucket
955 length.
956
957 Impact: Medium
958
959 Permission: java.lang.management.ManagementPermission(monitor)
960
961 Note:
962
963 The following options must be specified using either key or
964 key=value syntax.
965
966 options:
967
968 • verbose: (Optional) Dump the content of each dictionary entry
969 for all class loaders (BOOLEAN, false) .
970
971 VM.system_properties
972 Prints the system properties.
973
974 Impact: Low
975
976 Permission: java.util.PropertyPermission(*, read)
977
978 VM.uptime [options]
979 Prints the VM uptime.
980
981 Impact: Low
982
983 Note:
984
985 The following options must be specified using either key or
986 key=value syntax.
987
988 options:
989
990 • -date: (Optional) Adds a prefix with the current date (BOOL‐
991 EAN, false)
992
993 VM.version
994 Prints JVM version information.
995
996 Impact: Low
997
998 Permission: java.util.PropertyPermission(java.vm.version, read)
999
1000
1001
1002JDK 18 2022 JCMD(1)