Jstat (JVM Statistics monitoring Tool)
Jstat is a command-line tool for monitoring the various health status information for a virtual machine.
It can display the local or remote virtual machine in the process of the class loading, memory, garbage Collection, JIT compilation and other running data, in the absence of GUI graphical interface, only provide a plain text console environment on the server, it will be the run-time positioning virtual machine performance problems of the preferred tool
The JSTAT command format is
jstat [Option Vmid [Interval[s|ms] [count]]
For Vmid and Lvmid in the command format, it is important to note that if it is a local virtual machine process, Vmid and lvmid are consistent, and if it is a remote virtual machine process, the VMID format should be
[Protocol:] [//] lvmid[@hostname [:p Ort]/servername]
The parameters interval and count represent the query interval and number of times, and if you omit these two arguments, the description is queried only once,
Suppose you need to query the process 2764 garbage collection every 250 milliseconds and query 20 times. The command format should be:
JSTAT-GC 2764 250 20
Option options represents the virtual machine information that users want to query, mainly divided into three categories, class loading, garbage collection, run-time compilation status
Some of the common option
-class |
Monitor class load, unload quantity, total space, and time spent on class loading |
-gc |
Monitor Java heap status, including Eden Zone, two survivor, old age, permanent generation capacity, used space, GC time totals, and more |
-gccapacity |
The monitoring content is basically the same as-GC, but the output is primarily concerned with the maximum and minimum space used by each area of the Java heap |
-gcutil |
The monitoring content is basically the same as-GC, but the output is primarily concerned with the percentage of space used for total space |
-gccause |
Same as-gcutil function, but additional output causes the last GC to occur |
-gcnew |
Monitor New generation GC status |
-gcnewcapacity |
Monitoring content is basically the same as-gcnew, the output is mainly concerned with the maximum, minimum space |
-gcold |
Monitoring the status of GC in the old age |
-gcoldcapacity |
Monitoring content is basically the same as-gcold, the output is mainly concerned with the maximum, minimum space |
-gcpermcapacity |
Maximum, minimum space used for output permanent generation |
-compiler |
Output JIT compiler compiled methods, time-consuming and other information |
-printcompilation |
How the output has been JIT-compiled |
We can also use Jstat-help to see what Jstat provides and how to
Here's an example.
S0-Survior0
S1-Survior1
Eden, E
O-old
P--Permanent
Ygc
FGC
and T
So if there is no GUI, we look at the Jstat to see the health of the virtual machine, and then run the state to detect the state of the system.
Jstat: Virtual Machine Statistics monitoring tool