jstat monitoring tool of the JVM

Reference blog: https://www.cnblogs.com/lxcmyf/p/9878293.html

 

jstat (JVMStatisticsMonitoringTool) command is used to monitor virtual machines running various status information line tool. It can display local or remote virtual machine in the process of class loading, memory, garbage collection, JIT compiler and other operating data,
no GUI graphical interface, provides only a text-only console server environment, it will be run on virtual positioning machine tool of choice for performance problems.

Command jstat: we can see with [option], option option represents the information the user wants to query the virtual machine, mainly divided into three categories: class loading, garbage collection, runtime compilation status. You can tell VMID (unique process ID), and talking to representatives of the query interval interval and count the number of times and,
if you omit both parameters illustrate the query only once.

 

Suppose you want to query every 250 milliseconds to process 40,416 garbage collection process idea situation, a total of 20 inquiries, that the command should be: jstat -gc 17312 250 20  

 

Execution result can be seen in the representative area Survivor0 S0C is representative S1C is Survivor1 region, C is the capacity of the representative meaning, U represents mean is used, the capacity of representatives of EC Eden area using representative of Eden EU area. OC capacity on behalf of old age, OU representatives to use the old era.
M represents metadata space. Representative CCSU CCSC and capacity size using a space-based compression and compression of classes, the number of YGC, YGCT recovery time required for the young generation. FGC is represented by the number of Full GC, FGCT on behalf of Full GC time, GCT garbage collection on behalf of the entire time.

 

jstat -options 

 

You can list the currently supported versions of JVM options are common

 

l class (class loader) 

l  compiler (JIT) 

l gc (GC heap state) 

l gccapacity (district size) 

l gccause (the most recent statistics and reasons GC) 

l gcnew (New statistics)

l gcnewcapacity (Area Size)

l gcold (old statistics)

l gcoldcapacity (old size)

l gcpermcapacity (permanent area size)

l gcutil (GC statistical summary)

l printcompilation (HotSpot compiler statistics)

 

View the process with id 17312 load class information: jstat -class 17312

Display column name specific description

Loaded loaded class number
Bytes load class number of bytes occupied by
the number of classes Unloaded unloaded
Bytes Bytes unloaded class
time Time spent loading and unloading of classes

See why gc occurred:

jstat -gccause 17312 250 20

 

GC can be seen that did not happen within the most recent process

 

If we are to monitor the new generation, jstat -gcnew 17312 250 20 this order on the part of the new generation and the associated lists only.

You can see the old year related properties no longer show

 

If we monitored years old, jstat -gcold 17312 250 20 This command lists only the part related to years and older.

We can see the young generation no longer display the relevant attributes

 

 jstat -compiler <pid> VM display real-time information such as the number of compilation.

 

Column name displayed detailed description of
the number of execution Compiled compilation task
Failed to compile the number of task execution failed
Invalid compilation task execution failure of the number of
Time compilation task time-consuming
FailedType last compilation failed task type
FailedMethod last compilation failed tasks where the classes and methods

 

jstat -gccapacity <pid>:可以显示,VM内存中三代(young,old,perm)对象的使用和占用大小

显示列名 具体描述
NGCMN 年轻代(young)中初始化(最小)的大小(字节)
NGCMX 年轻代(young)的最大容量 (字节)
NGC 年轻代(young)中当前的容量 (字节)
S0C 年轻代中第一个survivor(幸存区)的容量 (字节)
S1C 年轻代中第二个survivor(幸存区)的容量 (字节)
EC 年轻代中Eden(伊甸园)的容量 (字节)
OGCMN old代中初始化(最小)的大小 (字节)
OGCMX old代的最大容量(字节)
OGC old代当前新生成的容量 (字节)
OC Old代的容量 (字节)
PGCMN perm代中初始化(最小)的大小 (字节)
PGCMX perm代的最大容量 (字节)
PGC perm代当前新生成的容量 (字节)
PC Perm(持久代)的容量 (字节)
YGC 从应用程序启动到采样时年轻代中gc次数
FGC 从应用程序启动到采样时old代(全gc)gc次数

 

jstat -gcutil <pid>:统计gc信息

S0 年轻代中第一个survivor(幸存区)已使用的占当前容量百分比
S1 年轻代中第二个survivor(幸存区)已使用的占当前容量百分比
E 年轻代中Eden(伊甸园)已使用的占当前容量百分比
O old代已使用的占当前容量百分比
P perm代已使用的占当前容量百分比
YGC 从应用程序启动到采样时年轻代中gc次数
YGCT 从应用程序启动到采样时年轻代中gc所用时间(s)
FGC 从应用程序启动到采样时old代(全gc)gc次数
FGCT 从应用程序启动到采样时old代(全gc)gc所用时间(s)
GCT 从应用程序启动到采样时gc用的总时间(s)

 

Guess you like

Origin www.cnblogs.com/cheng21553516/p/11223557.html