CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit www.eclipse.org/openj9/docs

Java statistics monitoring (jstat) tool

Use the jstat tool to obtain Java Virtual Machine (JVM) statistics. The tool is similar to the HotSpot tool of the same name; the OpenJ9 version of jstat is an independent implementation, added for compatibility.

The command syntax is as follows:

jstat [<option>] [<vmid>]

where vmid is the Attach API virtual machine identifier for the Java process. This ID is typically the same as the operating system process ID, unless you specified the -Dcom.ibm.tools.attach.id system property when you started the process.

VMID is shown in Java process status (jps) tool or other Attach API-based tools.

On its own, jstat prints help information. The values for <option> are as follows:

  • -J: supplies arguments to the JVM that is running the jstat command. You can use multiple -J options, for example: jstat -J-Xmx10m -J-Dcom.ibm.tools.attach.enable=yes
  • -h: prints help information
  • -options: lists the available command options
  • -class: displays classloading statistics

The output has the following format:

Class Loaded    Class Unloaded
         860                 0

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 OpenJ9. For more information about differences, see Switching to OpenJ9.