Java diagnostic command (jcmd) tool

Use the jcmd tool to run diagnostic commands on a specified VM.

Note: Running diagnostic commands can significantly affect the performance of the target VM.

The command syntax is as follows:

jcmd [<options>] [<vmid | display name | 0> <arguments>]

Where:

Examples:

jcmd 31452 Thread.print
jcmd 31452 help Dump.heap
jcmd 31452 Dump.heap myHeapDump

Note: From the 0.59.0 release onwards, when jcmd Dump.heap is used to request a heap dump, the compact option is added to the dump request by default, making the full request request=exclusive+compact+prepwalk.

Restrictions: This tool is not supported and is subject to change or removal in future releases. Although similar in usage and output to the HotSpot tool of the same name, this tool is a different implementation that is specific to Eclipse OpenJ9™. For information about the differences between these two implementations, see Switching to OpenJ9.

The tool uses the Attach API, and has the following limitations:

For more information about the Attached API, including how to enable and secure it, see Java Attach API.

See Also