当前位置:网站首页>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
边栏推荐
- Unity 模型简化/合并 一键式插件
- leetcode/ 前 n 个数字二进制中 1 的个数
- Data too long for column 'data' at row 1 and the garbled code caused by setting to longblob are solved. node-mysql
- VSCode 如何开启多个终端?如何横向显示?
- [QT] solve the problem of Chinese garbled code output from QT console
- mysql 查询当前数据库下的表名
- Android interview question: why do activities rebuild ViewModel and still exist—— Jetpack series (3)
- What projects can make money online? Is it reliable to be we media?
- Run length test of R language: use the runs.test function to perform run length test on binary sequence data (check whether the sequence is random)
- It is said that screentogif is a GIF recording artifact, but I don't know that its strength is far from here
猜你喜欢

阻塞队列分析
![(15) [driver development] over written copy](/img/1c/68dfff5671add1fe91567e4df34135.png)
(15) [driver development] over written copy

VO, dto, do, Po distinction and use

Unity Animator动画与状态机

【datawhale202207】强化学习:策略梯度和近端策略优化
![[QT] solve the problem of Chinese garbled code output from QT console](/img/09/8af91d2a0327bd1d3c7b64f2b8185f.png)
[QT] solve the problem of Chinese garbled code output from QT console

(2022牛客多校二)L-Link with Level Editor I(动态规划)

Evolution of coupon architecture under C2B mode
![(16) [system call] track system call (3 rings)](/img/b0/011351361135fd9f8e2d0d31749f73.png)
(16) [system call] track system call (3 rings)

Blocking Queue Analysis
随机推荐
Get URL of [url reference]? For the following parameters, there are two ways to get the value of the corresponding parameter name and convert the full quantity to the object structure
(16) [system call] track system call (3 rings)
(牛客多校二)J-Link with Arithmetic Progression(最小二乘法/三分)
What determines the "personality" of AI robots?
Draw Bezier curve through screen interaction
VSCode 如何开启多个终端?如何横向显示?
A little experience about von Mises distribution
Binary search tree (day 75)
In depth analysis: is the hottest business model in 2022 linked by 2+1 a legal model?
10. Rendering Basics
JTAG debugging source level debugging of arm bare board debugging
【Unity3D】UGUI回调函数
Xiaomi 12s UTRA Leica watermark generation online tool
R language uses data.table function to create data.table data (use: operator to create continuous numeric vector)
Detailed explanation of arm instruction CMP
The most comprehensive multi-threaded application tutorial - summary in detail
深度解析:2022年最火的商业模式链动2+1,是合法模式吗?
Era5 dataset description
node.express中req.body总是undefind解决
leetcode/二进制加法