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 Eclipse 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 thejstat
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.
The tool uses the Attach API, and has the following limitations:
- Displays information only for local processes that are owned by the current user, due to security considerations.
- Displays information for OpenJ9 Java processes only
- Does not show information for processes whose Attach API is disabled. Note: The Attach API is disabled by default on z/OS.
For more information about the Attach API, including how to enable and secure it, see Java Attach API.