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 thejcmd 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.queue
125 Prints methods queued for compilation.
126
127 Impact: Low
128
129 Permission: java.lang.management.ManagementPermission(monitor)
130
131 Compiler.directives_add *filename* *arguments*
132 Adds compiler directives from a file.
133
134 Impact: Low
135
136 Permission: java.lang.management.ManagementPermission(monitor)
137
138 arguments:
139
140 filename: The name of the directives file (STRING, no default
141 value)
142
143 Compiler.directives_clear
144 Remove all compiler directives.
145
146 Impact: Low
147
148 Permission: java.lang.management.ManagementPermission(monitor)
149
150 Compiler.directives_print
151 Prints all active compiler directives.
152
153 Impact: Low
154
155 Permission: java.lang.management.ManagementPermission(monitor)
156
157 Compiler.directives_remove
158 Remove latest added compiler directive.
159
160 Impact: Low
161
162 Permission: java.lang.management.ManagementPermission(monitor)
163
164 GC.class_histogram [options]
165 Provides statistics about the Java heap usage.
166
167 Impact: High --- depends on Java heap size and content.
168
169 Permission: java.lang.management.ManagementPermission(monitor)
170
171 Note:
172
173 The options must be specified using either key or key=value syn‐
174 tax.
175
176 options:
177
178 · -all: (Optional) Inspects all objects, including unreachable
179 objects (BOOLEAN, false)
180
181 GC.class_stats [options] [arguments]
182 Provide statistics about Java class meta data.
183
184 Impact: High --- depends on Java heap size and content.
185
186 Note:
187
188 The options must be specified using either key or key=value syn‐
189 tax.
190
191 options:
192
193 · -all: (Optional) Shows all columns (BOOLEAN, false)
194
195 · -csv: (Optional) Prints in CSV (comma-separated values) format
196 for spreadsheets (BOOLEAN, false)
197
198 · -help: (Optional) Shows the meaning of all the columns (BOOL‐
199 EAN, false)
200
201 arguments:
202
203 · columns: (Optional) Comma-separated list of all the columns to
204 be shown. If not specified, the following columns are shown:
205
206 · InstBytes
207
208 · KlassBytes
209
210 · CpAll
211
212 · annotations
213
214 · MethodCount
215
216 · Bytecodes
217
218 · MethodAll
219
220 · ROAll
221
222 · RWAll
223
224 · Total
225
226 (STRING, no default value)
227
228 GC.finalizer_info
229 Provides information about the Java finalization queue.
230
231 Impact: Medium
232
233 Permission: java.lang.management.ManagementPermission(monitor)
234
235 GC.heap_dump [options] [arguments]
236 Generates a HPROF format dump of the Java heap.
237
238 Impact: High --- depends on the Java heap size and content. Re‐
239 quest a full GC unless the -all option is specified.
240
241 Permission: java.lang.management.ManagementPermission(monitor)
242
243 Note:
244
245 The following options must be specified using either key or
246 key=value syntax.
247
248 options:
249
250 · -all: (Optional) Dump all objects, including unreachable ob‐
251 jects (BOOLEAN, false)
252
253 arguments:
254
255 · filename: The name of the dump file (STRING, no default value)
256
257 GC.heap_info
258 Provides generic Java heap information.
259
260 Impact: Medium
261
262 Permission: java.lang.management.ManagementPermission(monitor)
263
264 GC.run Calls java.lang.System.gc().
265
266 Impact: Medium --- depends on the Java heap size and content.
267
268 GC.run_finalization
269 Calls java.lang.System.runFinalization().
270
271 Impact: Medium --- depends on the Java content.
272
273 JFR.check [options]
274 See JFR.check [https://www.oracle.com/pls/top‐
275 ic/lookup?ctx=en/java/javase/11/tools&id=JFR‐
276 CR-GUID-DA391CC1-B5D8-44F1-AEDD-9A534C8DD009] in the Java Flight
277 Recorder Command Reference.
278
279 JFR.configure [options]
280 See JFR.configure [https://www.oracle.com/pls/top‐
281 ic/lookup?ctx=en/java/javase/11/tools&id=JFR‐
282 CR-GUID-737D234E-FD69-4E8E-A9F7-06AE073648DD] in the Java Flight
283 Recorder Command Reference.
284
285 JFR.dump [options]
286 See JFR.dump [https://www.oracle.com/pls/topic/lookup?ctx=en/ja‐
287 va/javase/11/tools&id=JFR‐
288 CR-GUID-6EB11926-4DAF-4B99-AF20-7FCD284EE6C1] in the Java Flight
289 Recorder Command Reference.
290
291 JFR.start [options]
292 See JFR.start [https://www.oracle.com/pls/top‐
293 ic/lookup?ctx=en/java/javase/11/tools&id=JFR‐
294 CR-GUID-8DC13618-1515-4479-B0FC-9F4394BE5455] in the Java Flight
295 Recorder Command Reference.
296
297 JFR.stop [options]
298 See JFR.stop [https://www.oracle.com/pls/topic/lookup?ctx=en/ja‐
299 va/javase/11/tools&id=JFR‐
300 CR-GUID-66CC94C8-8EDF-4BB6-8E7A-49973025D4D9] in the Java Flight
301 Recorder Command Reference.
302
303 JVMTI.agent_load [arguments]
304 Loads JVMTI native agent.
305
306 Impact: Low
307
308 Permission: java.lang.management.ManagementPermission(control)
309
310 arguments:
311
312 · library path: Absolute path of the JVMTI agent to load.
313 (STRING, no default value)
314
315 · agent option: (Optional) Option string to pass the agent.
316 (STRING, no default value)
317
318 JVMTI.data_dump
319 Signals the JVM to do a data-dump request for JVMTI.
320
321 Impact: High
322
323 Permission: java.lang.management.ManagementPermission(monitor)
324
325 ManagementAgent.start [options]
326 Starts remote management agent.
327
328 Impact: Low --- no impact
329
330 Note:
331
332 The following options must be specified using either key or
333 key=value syntax.
334
335 options:
336
337 · config.file: (Optional) Sets com.sun.management.config.file
338 (STRING, no default value)
339
340 · jmxremote.host: (Optional) Sets com.sun.management.jmxre‐
341 mote.host (STRING, no default value)
342
343 · jmxremote.port: (Optional) Sets com.sun.management.jmxre‐
344 mote.port (STRING, no default value)
345
346 · jmxremote.rmi.port: (Optional) Sets com.sun.management.jmxre‐
347 mote.rmi.port (STRING, no default value)
348
349 · jmxremote.ssl: (Optional) Sets com.sun.management.jmxre‐
350 mote.ssl (STRING, no default value)
351
352 · jmxremote.registry.ssl: (Optional) Sets com.sun.manage‐
353 ment.jmxremote.registry.ssl (STRING, no default value)
354
355 · jmxremote.authenticate: (Optional) Sets com.sun.manage‐
356 ment.jmxremote.authenticate (STRING, no default value)
357
358 · jmxremote.password.file: (Optional) Sets com.sun.manage‐
359 ment.jmxremote.password.file (STRING, no default value)
360
361 · jmxremote.access.file: (Optional) Sets com.sun.manage‐
362 ment.jmxremote.acce ss.file (STRING, no default value)
363
364 · jmxremote.login.config: (Optional) Sets com.sun.manage‐
365 ment.jmxremote.log in.config (STRING, no default value)
366
367 · jmxremote.ssl.enabled.cipher.suites: (Optional) Sets
368 com.sun.management.
369
370 · jmxremote.ssl.enabled.cipher.suite: (STRING, no default value)
371
372 · jmxremote.ssl.enabled.protocols: (Optional) Sets com.sun.man‐
373 agement.jmxr emote.ssl.enabled.protocols (STRING, no default
374 value)
375
376 · jmxremote.ssl.need.client.auth: (Optional) Sets com.sun.man‐
377 agement.jmxre mote.need.client.auth (STRING, no default value)
378
379 · jmxremote.ssl.config.file: (Optional) Sets com.sun.manage‐
380 ment.jmxremote. ssl_config_file (STRING, no default value)
381
382 · jmxremote.autodiscovery: (Optional) Sets com.sun.manage‐
383 ment.jmxremote.au todiscovery (STRING, no default value)
384
385 · jdp.port: (Optional) Sets com.sun.management.jdp.port (INT, no
386 default value)
387
388 · jdp.address: (Optional) Sets com.sun.management.jdp.address
389 (STRING, no default value)
390
391 · jdp.source_addr: (Optional) Sets com.sun.manage‐
392 ment.jdp.source_addr (STRING, no default value)
393
394 · jdp.ttl: (Optional) Sets com.sun.management.jdp.ttl (INT, no
395 default value)
396
397 · jdp.pause: (Optional) Sets com.sun.management.jdp.pause (INT,
398 no default value)
399
400 · jdp.name: (Optional) Sets com.sun.management.jdp.name (STRING,
401 no default value)
402
403 ManagementAgent.start_local
404 Starts the local management agent.
405
406 Impact: Low --- no impact
407
408 ManagementAgent.status
409 Print the management agent status.
410
411 Impact: Low --- no impact
412
413 Permission: java.lang.management.ManagementPermission(monitor)
414
415 ManagementAgent.stop
416 Stops the remote management agent.
417
418 Impact: Low --- no impact
419
420 Thread.print [options]
421 Prints all threads with stacktraces.
422
423 Impact: Medium --- depends on the number of threads.
424
425 Permission: java.lang.management.ManagementPermission(monitor)
426
427 Note:
428
429 The following options must be specified using either key or
430 key=value syntax.
431
432 options:
433
434 · -l: (Optional) Prints java.util.concurrent locks (BOOLEAN,
435 false)
436
437 VM.classloader_stats
438 Prints statistics about all ClassLoaders.
439
440 Impact: Low
441
442 Permission: java.lang.management.ManagementPermission(monitor)
443
444 VM.class_hierarchy [options] [arguments]
445 Prints a list of all loaded classes, indented to show the class
446 hierarchy. The name of each class is followed by the ClassLoad‐
447 erData* of its ClassLoader, or "null" if it is loaded by the
448 bootstrap class loader.
449
450 Impact: Medium --- depends on the number of loaded classes.
451
452 Permission: java.lang.management.ManagementPermission(monitor)
453
454 Note:
455
456 The following options must be specified using either key or
457 key=value syntax.
458
459 options:
460
461 · -i: (Optional) Inherited interfaces should be printed. (BOOL‐
462 EAN, false)
463
464 · -s: (Optional) If a class name is specified, it prints the
465 subclasses. If the class name is not specified, only the su‐
466 perclasses are printed. (BOOLEAN, false)
467
468 arguments:
469
470 · classname: (Optional) The name of the class whose hierarchy
471 should be printed. If not specified, all class hierarchies
472 are printed. (STRING, no default value)
473
474 VM.command_line
475 Prints the command line used to start this VM instance.
476
477 Impact: Low
478
479 Permission: java.lang.management.ManagementPermission(monitor)
480
481 VM.dynlibs
482 Prints the loaded dynamic libraries.
483
484 Impact: Low
485
486 Permission: java.lang.management.ManagementPermission(monitor)
487
488 VM.info
489 Prints information about the JVM environment and status.
490
491 Impact: Low
492
493 Permission: java.lang.management.ManagementPermission(monitor)
494
495 VM.log [options]
496 Lists current log configuration, enables/disables/configures a
497 log output, or ro tates all logs.
498
499 Impact: Low
500
501 Permission: java.lang.management.ManagementPermission(control)
502
503 options:
504
505 Note:
506
507 The following options must be specified using either key or
508 key=value syntax.
509
510 · output: (Optional) The name or index (#) of output to config‐
511 ure. (STRING, no default value)
512
513 · output_options: (Optional) Options for the output. (STRING,
514 no default value)
515
516 · what: (Optional) Configures what tags to log. (STRING, no de‐
517 fault value )
518
519 · decorators: (Optional) Configures which decorators to use.
520 Use 'none' or an empty value to remove all. (STRING, no de‐
521 fault value)
522
523 · disable: (Optional) Turns off all logging and clears the log
524 configuration. (BOOLEAN, no default value)
525
526 · list: (Optional) Lists current log configuration. (BOOLEAN,
527 no default value)
528
529 · rotate: (Optional) Rotates all logs. (BOOLEAN, no default
530 value)
531
532 VM.flags [options]
533 Prints the VM flag options and their current values.
534
535 Impact: Low
536
537 Permission: java.lang.management.ManagementPermission(monitor)
538
539 Note:
540
541 The following options must be specified using either key or
542 key=value syntax.
543
544 options:
545
546 · -all: (Optional) Prints all flags supported by the VM (BOOL‐
547 EAN, false).
548
549 VM.native_memory [options]
550 Prints native memory usage
551
552 Impact: Medium
553
554 Permission: java.lang.management.ManagementPermission(monitor)
555
556 Note:
557
558 The following options must be specified using either key or
559 key=value syntax.
560
561 options:
562
563 · summary: (Optional) Requests runtime to report current memory
564 summary, which includes total reserved and committed memory,
565 along with memory usage summary by each subsystem. (BOOLEAN,
566 false)
567
568 · detail: (Optional) Requests runtime to report memory alloca‐
569 tion >= 1K by each callsite. (BOOLEAN, false)
570
571 · baseline: (Optional) Requests runtime to baseline current mem‐
572 ory usage, so it can be compared against in later time.
573 (BOOLEAN, false)
574
575 · summary.diff: (Optional) Requests runtime to report memory
576 summary comparison against previous baseline. (BOOLEAN,
577 false)
578
579 · detail.diff: (Optional) Requests runtime to report memory de‐
580 tail comparison against previous baseline, which shows the
581 memory allocation activities at different callsites. (BOOL‐
582 EAN, false)
583
584 · shutdown: (Optional) Requests runtime to shutdown itself and
585 free the memory used by runtime. (BOOLEAN, false)
586
587 · statistics: (Optional) Prints tracker statistics for tuning
588 purpose. (BOOLEAN, false)
589
590 · scale: (Optional) Memory usage in which scale, KB, MB or GB
591 (STRING, KB)
592
593 VM.print_touched_methods
594 Prints all methods that have ever been touched during the life‐
595 time of this JVM.
596
597 Impact: Medium --- depends on Java content.
598
599 VM.set_flag [arguments]
600 Sets the VM flag option by using the provided value.
601
602 Impact: Low
603
604 Permission: java.lang.management.ManagementPermission(control)
605
606 arguments:
607
608 · flag name: The name of the flag that you want to set (STRING,
609 no default value)
610
611 · string value: (Optional) The value that you want to set
612 (STRING, no default value)
613
614 VM.stringtable [options]
615 Dumps the string table.
616
617 Impact: Medium --- depends on the Java content.
618
619 Permission: java.lang.management.ManagementPermission(monitor)
620
621 Note:
622
623 The following options must be specified using either key or
624 key=value syntax.
625
626 options:
627
628 · -verbose: (Optional) Dumps the content of each string in the
629 table (BOOLEAN, false)
630
631 VM.symboltable [options]
632 Dumps the symbol table.
633
634 Impact: Medium --- depends on the Java content.
635
636 Permission: java.lang.management.ManagementPermission(monitor)
637
638 Note:
639
640 The following options must be specified using either key or
641 key=value syntax).
642
643 options:
644
645 · -verbose: (Optional) Dumps the content of each symbol in the
646 table (BOOLEAN, false)
647
648 VM.systemdictionary
649 Prints the statistics for dictionary hashtable sizes and bucket
650 length.
651
652 Impact: Medium
653
654 Permission: java.lang.management.ManagementPermission(monitor)
655
656 Note:
657
658 The following options must be specified using either key or
659 key=value syntax.
660
661 options:
662
663 · verbose: (Optional) Dump the content of each dictionary entry
664 for all class loaders (BOOLEAN, false) .
665
666 VM.system_properties
667 Prints the system properties.
668
669 Impact: Low
670
671 Permission: java.util.PropertyPermission(*, read)
672
673 VM.uptime [options]
674 Prints the VM uptime.
675
676 Impact: Low
677
678 Note:
679
680 The following options must be specified using either key or
681 key=value syntax.
682
683 options:
684
685 · -date: (Optional) Adds a prefix with the current date (BOOL‐
686 EAN, false)
687
688 VM.version
689 Prints JVM version information.
690
691 Impact: Low
692
693 Permission: java.util.PropertyPermission(java.vm.version, read)
694
695
696
697JDK 13 2018 JCMD(1)