当前位置:网站首页>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
边栏推荐
- 【datawhale202207】强化学习:策略梯度和近端策略优化
- [C language] in depth understanding of pointers and arrays (phase I)
- SAP FICO section III BDC and ltmc import S4 financial account
- VSCode 如何开启多个终端?如何横向显示?
- Brief introduction of acoustic filter Market
- Ffmpeg notes (I) fundamentals of audio and video
- Codeforces Round #809 (Div. 2)
- Mechanism and principle of multihead attention and masked attention
- Sword finger offer 45. arrange the array into the smallest number
- Design of automatic machine dot drawing script based on C language
猜你喜欢

Ffmpeg notes (I) fundamentals of audio and video
![(14)[驱动开发]配置环境 VS2019 + WDK10 写 xp驱动](/img/90/0d94d26be8128d77de65919763fda5.png)
(14)[驱动开发]配置环境 VS2019 + WDK10 写 xp驱动

Xiaomi 12s UTRA Leica watermark generation online tool

Design of automatic machine dot drawing script based on C language

剑指 Offer 45. 把数组排成最小的数

ARM裸板调试之JTAG调试源码级调试

都说ScreenToGif是GIF录制神器,却不知其强大之处远不在此

Case ---- how efficient is the buffer stream compared with the ordinary input stream and output stream?
![(14) [driver development] configuration environment vs2019 + wdk10 write XP driver](/img/90/0d94d26be8128d77de65919763fda5.png)
(14) [driver development] configuration environment vs2019 + wdk10 write XP driver

【每日一练】day(14)
随机推荐
HTB-Optimum
【datawhale202207】强化学习:强化学习基础
U-boot-1.1.6 transplant notes (beginner)
(Niuke multi School II) G-LINK with monotonic subsequence (construction question)
Mechanism and principle of multihead attention and masked attention
Openzeppelin scalable template library contract initialization details
[node] the service port is occupied error: listen eaddinuse: address already in use::: 9000- how to close the port started by node
Typedef usage and template
"Everyday Mathematics" serial 61: March 1
Context must be a dict rater solution
GF Securities online account opening? Is it safe?
机器学习 Keras拟合正弦函数
[C language] in depth understanding of pointers and arrays (phase I)
R language uses data.table function to create data.table data (use: operator to create continuous numeric vector)
(2022 Niuke multi School II) l-link with level editor I (dynamic planning)
Detailed annotation and analysis of start.s of uboot
Use abp Zero builds a third-party login module (4): wechat applet development
Data too long for column 'data' at row 1 and the garbled code caused by setting to longblob are solved. node-mysql
Ffmpeg notes (I) fundamentals of audio and video
This is how the permission system is designed, yyds