jdk.jcmd/sun.tools.jstat.Jstat - "jstat" Command

Q

How to run "jstat" command from JDK lib\modules JImage file?

✍: FYIcenter

A

"jstat" command allows you to run the JVM Statistics Monitoring Tool.

"jstat" command is supported by the jmods\jdk.jcmd.jmod module file, which is also linked into the lib\modules JImage file in JDK 9, 10, and 11.

You can run the "jstat" command using the lib\modules JImage file as described below using JDK 11 as an example:

C:\fyicenter>set JDK_HOME=\fyicenter\jdk-11.0.1

C:\fyicenter>%JDK_HOME%\bin\java --module jdk.jcmd/sun.tools.jstat.Jstat

Usage: jstat --help|-options
       jstat -<option> [-t] [-h<lines>] <vmid> [<interval> [<count>]]

Definitions:
  <option>      An option reported by the -options option
  <vmid>        Virtual Machine Identifier. A vmid takes the following form:
                     <lvmid>[@<hostname>[:<port>]]
                Where <lvmid> is the local vm identifier for the target
                Java virtual machine, typically a process id; <hostname> is
                the name of the host running the target Java virtual machine;
                and <port> is the port number for the rmiregistry on the
                target host. See the jvmstat documentation for a more complete
                description of the Virtual Machine Identifier.
  <lines>       Number of samples between header lines.
  <interval>    Sampling interval. The following forms are allowed:
                    <n>["ms"|"s"]
                Where <n> is an integer and the suffix specifies the units as
                milliseconds("ms") or seconds("s"). The default units are "ms".
  <count>       Number of samples to take before terminating.
  -J<flag>      Pass <flag> directly to the runtime system.
  -? -h --help  Prints this help message.
  -help         Prints this help message.

 

jdk.jconsole/sun.tools.jconsole.JConsole - "jconsole" Command

jdk.jcmd/sun.tools.jps.Jps - "jps" Command

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-09-16, 291👍, 0💬