当前位置:网站首页>Jstat command summary [easy to understand]
Jstat command summary [easy to understand]
2022-07-25 06:14:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
jvm Statistical information monitoring tools
One 、 jstat What is it?
jstat yes JDK A lightweight gadget that comes with you . Full name “Java Virtual Machine statistics monitoring tool”, It is located in java Of bin Under the table of contents , Mainly used JVM Built in instructions for Java Real time command line monitoring of application resources and performance , Yes, yes. Heap size And garbage collection monitoring .
jstat It is a command line tool used to see various running state information of virtual machine . It can show class loading in local or remote virtual machine processes 、 Memory 、 garbage collection 、jit Compile and other operation data , It's online positioning jvm Preferred tool for performance .
Two 、 jstat Command format
jstat [ generalOption | outputOptions vmid [interval[s|ms] [count]] ]
- generalOption : Single common command line options , Such as -help, -options, or -version.
- outputOptions : One or more output options , By a single statOption Options make up , You can talk to -t, -h, and -J And so on .
Usage: jstat -help|-options
jstat -<option> [-t] [-h<lines>] <vmid> [<interval> [<count>]]
Definitions:
<option> An option reported by the -options option( Optional parameters )
<vmid> Virtual Machine Identifier. A vmid takes the following form:
<lvmid>[@<hostname>[:<port>]]( Identifier of the virtual machine )
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"]( Sampling interval : A hair | second )
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.( The number of samples to be taken before termination )
-J<flag> Pass <flag> directly to the runtime system.
# option: Parameter options
# -t: You can add... To the printed column Timestamp Column , It is used to display the running time of the system
# -h: It's possible to do this in the case of periodic data , You can output the header once after you specify how many lines to output
# vmid: Virtual Machine ID( Process pid)
# interval: The interval between each execution , The unit is millisecond
# count: Used to specify how many records to output , By default, it will always print 3、 ... and 、jstat Parameter options
> jstat -options
-class Show ClassLoad Information about ; -compiler Show JIT Information about compilation ; -gc Display and gc Related heap information ; -gccapacity Shows the capacity and usage of each generation ; -gcmetacapacity Show metaspace Size -gcnew Display the new generation information ; -gcnewcapacity Show the size and usage of the new generation ; -gcold Displays information about the elderly and permanent generations ; -gcoldcapacity Show the size of the old age ; -gcutil Show garbage collection information ; -gccause Display information about garbage collection ( through -gcutil), At the same time, it shows the inducement of the last or current garbage collection ; -printcompilation Output JIT Compiled method information Parameter name | Parameter description |
|---|---|
class | Used to view the statistics of class loading , According to load class The number of , And the space occupied . |
compiler | see HotSpot The statistics of compiler compilation in |
gc | see JVM Statistics of garbage collection in the middle pile , Can be displayed gc Information about , see gc The number of times , And time . The last five of them , Namely young gc The number of times ,young gc Time for ,full gc The number of times ,full gc Time for ,gc The total time of . |
gccapacity | Check out the new generation 、 Storage capacity of old generation and permanent generation , Can be displayed ,VM Three generations in memory (young,old,perm) Object usage and occupancy size |
gccause | Check the statistics of garbage collection ( This and -gcutil Options as ), If there is garbage collection , It also shows why garbage collection was last and is currently taking place |
gcmetacapacity | Show about metaspace Statistics of size . |
gcnew | Check out the new generation of garbage collection ,new Object information |
gcnewcapacity | Used to view the storage capacity of the new generation ,new Object information and its usage |
gcold | It is used to check the generation of the old generation and the generation of the permanent generation GC The situation of ,old Object information |
gcoldcapacity | Used to check the capacity of the old generation ,old Object information and its usage |
gcpermcapacity | Used to view the capacity of persistent generation ,perm Object information and its usage |
gcutil | Check out the new generation 、 Garbage collection of the old generation and the old generation |
printcompilation | At present VM Execution information |
Four 、 Parameter usage example
# Print out the result once on the screen
> jstat -gccause pid
# Constantly print out the results on the screen
> jstat -gccause pid 1 Each grid 1 Millisecond output
> jstat -gccause pid 2000 Each grid 2 Second output result Class load statistics class
PS C:\>
PS C:\> jstat -class 6368
Loaded Bytes Unloaded Bytes Time
1846 3621.2 0 0.0 0.98
PS C:\>- Loaded: load class The number of
- Bytes: The amount of space occupied
- Unloaded: Number of unloaded
- Bytes: Occupied space not loaded
- Time: Time
Compilation statistics compiler
PS C:\> jstat -compiler 6368
Compiled Failed Invalid Time FailedType FailedMethod
791 0 0 1.17 0
PS C:\>- Compiled: Number of compilations
- Failed: The number of failures
- Invalid: Unavailable quantity
- Time: Time
- FailedType: Failure type
- FailedMethod: The way to fail
Compilation statistics compiler
Garbage collection statistics gc
PS C:\> jstat -gc 6368
S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT
5120.0 5120.0 0.0 0.0 32768.0 29858.7 86016.0 0.0 4480.0 770.3 384.0 75.9 0 0.000 0 0.000 0.000
PS C:\>- S0C: The size of the first surviving area
- S1C: The size of the second surviving area
- S0U: The size of the first surviving area
- S1U: The size of the second surviving area
- EC: The size of Eden Park
- EU: The use size of Eden Park
- OC: Old age size
- OU: Old age use size
- MC: Method area size
- MU: Method area usage size
- CCSC: Compress class space size
- CCSU: Compressed class space usage size
- YGC: Garbage collection times of young generation
- YGCT: Young generation garbage collection consumes time
- FGC: Recycling times in the old days
- FGCT: Garbage collection used time in the old days
- GCT: The total time spent in garbage collection
Heap memory statistics gccapacity
PS C:\> jstat -gccapacity 6368
NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC
43008.0 687104.0 43008.0 5120.0 5120.0 32768.0 86016.0 1375232.0 86016.0 86016.0 0.0 1056768.0 4480.0 0.0 1048576.0 384.0 0 0
PS C:\>- NGCMN: The minimum capacity of the new generation
- NGCMX: The largest capacity of the new generation
- NGC: Current Cenozoic capacity
- S0C: The size of the first surviving area
- S1C: The size of the second surviving area
- EC: The size of Eden Park
- OGCMN: The smallest capacity in the old days
- OGCMX: The biggest capacity in the old days
- OGC: The current size of the elderly
- OC: The current size of the elderly
- MCMN: Minimum metadata capacity
- MCMX: Maximum metadata capacity
- MC: Current metadata space size
- CCSMN: Minimum compressed class space size
- CCSMX: Maximum compressed class space size
- CCSC: Current compressed class space size
- YGC: The younger generation gc frequency
- FGC: Old age GC frequency
New generation garbage collection statistics gcnew
PS C:\> jstat -gcnew 6368
S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
5120.0 5120.0 0.0 0.0 15 15 0.0 32768.0 29858.7 0 0.000
PS C:\>- S0C: The size of the first surviving area
- S1C: The size of the second surviving area
- S0U: The size of the first surviving area
- S1U: The size of the second surviving area
- TT: The number of times an object has survived in a new generation
- MTT: The maximum number of times an object has survived in a new generation
- DSS: The expected size of the surviving area
- EC: The size of Eden Park
- EU: The use size of Eden Park
- YGC: Garbage collection times of young generation
- YGCT: Young generation garbage collection consumes time
New generation memory statistics gcnewcapacity
PS C:\> jstat -gcnewcapacity 6368
NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC
43008.0 687104.0 43008.0 228864.0 5120.0 228864.0 5120.0 686080.0 32768.0 0 0
PS C:\>- NGCMN: The minimum capacity of the new generation
- NGCMX: The largest capacity of the new generation
- NGC: Current Cenozoic capacity
- S0CMX: The greatest survival 1 Area size
- S0C: The current survival 1 Area size
- S1CMX: The greatest survival 2 Area size
- S1C: The current survival 2 Area size
- ECMX: The largest Eden Park
- EC: The current size of Eden Park
- YGC: Garbage collection times of young generation
- FGC: Recovery times of the elderly
Old age garbage collection statistics gcold
PS C:\> jstat -gcold 6368
MC MU CCSC CCSU OC OU YGC FGC FGCT GCT
4480.0 770.3 384.0 75.9 86016.0 0.0 0 0 0.000 0.000
PS C:\>- MC: Method area size
- MU: Method area usage size
- CCSC: Compress class space size
- CCSU: Compressed class space usage size
- OC: Old age size
- OU: Old age use size
- YGC: Garbage collection times of young generation
- FGC: Recycling times in the old days
- FGCT: Garbage collection used time in the old days
- GCT: The total time spent in garbage collection
Memory statistics in the old days
PS C:\> jstat -gcoldcapacity 6368
OGCMN OGCMX OGC OC YGC FGC FGCT GCT
86016.0 1375232.0 86016.0 86016.0 0 0 0.000 0.000
PS C:\>- OGCMN: The smallest capacity in the old days
- OGCMX: The biggest capacity in the old days
- OGC: The current size of the elderly
- OC: Old age size
- YGC: Garbage collection times of young generation
- FGC: Recycling times in the old days
- FGCT: Garbage collection used time in the old days
- GCT: The total time spent in garbage collection
Metadata spatial statistics gcmetacapacity
PS C:\> jstat -gcmetacapacity 6368
MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT GCT
0.0 1056768.0 4480.0 0.0 1048576.0 384.0 0 0 0.000 0.000
PS C:\>- MCMN: Minimum metadata capacity
- MCMX: Maximum metadata capacity
- MC: Current metadata space size
- CCSMN: Minimum compressed class space size
- CCSMX: Maximum compressed class space size
- CCSC: Current compressed class space size
- YGC: Garbage collection times of young generation
- FGC: Recycling times in the old days
- FGCT: Garbage collection used time in the old days
- GCT: The total time spent in garbage collection
Summarize garbage collection statistics gcutil
PS C:\> jstat -gcutil 6368
S0 S1 E O M CCS YGC YGCT FGC FGCT GCT
0.00 0.00 91.12 0.00 17.19 19.76 0 0.000 0 0.000 0.000
PS C:\>- S0: survive 1 The current usage proportion of the zone
- S1: survive 2 The current usage proportion of the zone
- E: The use proportion of Eden Park
- O: The proportion used in the old age
- M: The usage ratio of metadata area
- CCS: Compress usage ratio
- YGC: Garbage collection times of young generation
- FGC: Recycling times in the old days
- FGCT: Garbage collection used time in the old days
- GCT: The total time spent in garbage collection
JVM Compilation method statistics
PS C:\> jstat -printcompilation 6368
Compiled Size Type Method 791 5510 1 com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl$FragmentContentDriver next PS C:\>- Compiled: Number of recently compiled methods
- Size: The number of bytecodes of the most recently compiled method
- Type: The compilation type of the recently compiled method .
- Method: Method name identification .
6、 ... and 、 Reference resources
jstat Command view jvm Of GC situation ( With Linux For example )
jvm Optimization must know series —— Monitoring tools
One java Memory leak investigation case
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/121084.html Link to the original text :https://javaforall.cn
边栏推荐
- The most comprehensive multi-threaded application tutorial - summary in detail
- Cout format output common functions and flags summary
- Data too long for column ‘data‘ at row 1以及设置成longblob造成的乱码解决。node-mysql
- Some common interview questions about IO stream and string
- Req.body in node.express is always undefind
- 【C语言】指针和数组的深入理解(第一期)
- (Niuke multi School II) G-LINK with monotonic subsequence (construction question)
- [Luogu p6629] string (runs) (tree array)
- HTB-Arctic
- 二叉搜索树(DAY 75)
猜你喜欢

Special episode of Goddess Festival | exclusive interview with Chinese AI goddess Zhang Qingqing's transformation from a female learning tyrant to a female entrepreneur

"Everyday Mathematics" serial 61: March 1

Mechanism and principle of multihead attention and masked attention

(2022牛客多校二)K-Link with Bracket Sequence I(动态规划)

Data too long for column ‘data‘ at row 1以及设置成longblob造成的乱码解决。node-mysql

Qunhui NPV Suite (NPV server) Download

Use abp Zero builds a third-party login module (4): wechat applet development
![(16)[系统调用]追踪系统调用(3环)](/img/b0/011351361135fd9f8e2d0d31749f73.png)
(16)[系统调用]追踪系统调用(3环)
![(16) [system call] track system call (3 rings)](/img/b0/011351361135fd9f8e2d0d31749f73.png)
(16) [system call] track system call (3 rings)

HTB-Optimum
随机推荐
(牛客多校二)J-Link with Arithmetic Progression(最小二乘法/三分)
Qunhui NPV Suite (NPV server) Download
有什么能在网上挣钱的项目啊?做自媒体靠谱吗?
(2022 Niuke multi school) D-Link with game glitch (SPFA)
R奇怪语法总结
Sword finger offer 45. arrange the array into the smallest number
Qt 5界面修改无效的问题解决QtDesigner修改之后无效的解决办法
VBA common objects
[C language] in depth understanding of pointers and arrays (phase I)
(2022 Niuke multi School II) l-link with level editor I (dynamic planning)
剑指 Offer 45. 把数组排成最小的数
R language uses data.table function to create data.table data (use: operator to create continuous numeric vector)
target_ compile_ features specified unknown feature “cxx_std_14“ for target
Xiaomi 12s UTRA Leica watermark generation online tool
机器学习 Keras拟合正弦函数
(2022牛客多校二)L-Link with Level Editor I(动态规划)
Interlocked atom access series of functions
mysql 查询当前数据库下的表名
How to play a data mining game entry Edition
Use abp Zero builds a third-party login module (4): wechat applet development