当前位置:网站首页>10. Find out the JVM operation status
10. Find out the JVM operation status
2022-07-18 23:43:00 【jerry_ dyy】
Find out JVM Health of , One of the most useful ways , Is the use of jstat command .
First, through jps You can find what you want java Process corresponding to PID, And then execute jstat –gc PID, You can see this Java process ( In fact, the essence is one JVM) Memory and GC The situation :
![]()
function jstat –gc PID after , You will see the following , Explain to you :
S0C: This is a From Survivor The size of the area
S1C: This is a To Survivor The size of the area
S0U: This is a From Survivor The size of memory currently used by the area
S1U: This is a To Survivor The size of memory currently used by the area
EC: This is a Eden The size of the area
EU: This is a Eden The size of memory currently used by the area
OC: This is the size of the old age
OU: This is the current memory size used in the old age
MC: This is the method area ( Forever 、 Metadata area ) Size
MU: This is the method area ( Forever 、 Metadata area ) The current memory size used
YGC: This is what the system has done so far Young GC frequency
YGCT: This is what the system has done so far Young GC The total time of
FGC: This is what the system has done so far Full GC frequency
FGCT: This is what the system has done so far Full GC The total time of
GCT: This is all. GC The total time of
And through jstat –gc PID 1000 10, Every 1 Seconds to update the latest line jstat Statistics , A total of execution 10 Time :

adopt jstat The main information we need to get is : The growth rate of new generation objects ,Young GC The trigger frequency of ,Young GC Time consuming , Every time Young GC How many objects survived , The growth rate of objects in the old age ,Full GC The trigger frequency of ,Full GC Time consuming .
Then we use this information , Allocate memory space reasonably , Try to keep the object in the younger generation instead of the older generation , Avoid frequent Full GC. This is to JVM Best performance optimization .
1、 The growth rate of new generation objects :
Such as through jstat –gc PID 1000 10 command , every other 1 Second update jstat Statistics , For example, the first second is displayed Eden Area occupied 250M, The second second second displays Eden Area occupied 255M, The third second displays Eden Area occupied 259M, Then we can roughly estimate Eden The object growth rate of the zone is : Every time 1 Second growth 5M.
2、Young GC The trigger frequency and time consumption of each time :
Or the example above , such as Eden The total size of the area is 1G, If you add 5M, So about 200s, in other words 3 branch 20 Every second Young GC. Every time Young GC The time consumption can be based on the operation of the system so far Young GC frequency , And the system so far Young GC Total time , Calculate every time Young GC Time consuming .
3、 Every time Young GC After that, how many objects are surviving and entering the old generation :
It needs to be monitored many times Young GC,Young GC How many objects are put into Survivor District , How many new objects have the elderly generation added , Get the growth rate of objects in the old age .
4、Full GC Trigger frequency and time consumption of :
Once you know the growth rate of the old age , Then you only need to know the total size of the old age , You can easily infer Full GC The trigger frequency of . Every time Full GC The time consumption can be based on the operation of the system so far Full GC frequency , And the system so far Full GC Total time , Calculate every time Full GC Time consuming .
边栏推荐
猜你喜欢
随机推荐
Use of MySQL index
Hibench generates benchmark data sets [wordcount as an example]
nodejs 定义错误验证机制
Back to the top, scroll bar slowly back to the top
[STL] simulation implementation vector
Leetcode adding two numbers
Mysql索引的使用
STM32F1与STM32CubeIDE编程实例-W25Q-SPI-Flash与FatFs移植
广州铁骑霸气“公主抱”,安全感拉满!
Ellipsis in excess of single line text, ellipsis in excess of multi line text, specify multiple lines
Guangzhou cavalry domineering "Princess hug", full of security!
nodeJS中利用第三方内置模块实现数字转大写功能
微信小程序_15,纯数据字段
pytest接口自动化测试框架 | 项目实战(pytest+allure+数据驱动)
leetcode-两数相加
pytest接口自动化测试框架 | pytest结合二次封装实现接口自动化
Summary of this week 2
res.cc的使用
p5js咖啡杯冒热气js特效
App product details source data interface









