当前位置:网站首页>JVM tuning ideas
JVM tuning ideas
2022-06-27 06:03:00 【The season when the monsoon dies】
JVM Operation forecast
Mainly depends on jstat gc -pid Command Statistics GC Operation of the . For example, the growth rate of young generation objects 、Young GC The trigger frequency and time consumption of each time 、 Every time Young GC After that, how many people survive and enter the elderly generation 、Full GC The trigger frequency and time consumption of each time etc. . On the basis of this information jvm Parameter adjustment .
The theoretical basis of optimization
- If an object can be eliminated in the younger generation, try not to let it enter the older generation
- Try not to trigger full GC
Trigger young GC Conditions :
- eden Lack of space
Trigger full GC Conditions :
- There is not enough space in the old age
- There is not enough space for permanent generation
- young GC when Triggered the old age space allocation guarantee mechanism .
Conditions for the object to enter the old age ( That is, it will affect the growth rate of objects in the old age ):
- Large objects go directly into the old generation
- Older people enter the older generation
- young GC According to the dynamic age determination mechanism , Put... At one time Survivor Object is greater than Survivor District 50%, Then the extra objects will be put into the old generation
full gc Than minor gc More reasons
- Excess caused by insufficient meta space full gc
- Display call System.gc() Cause superfluous full gc, This kind of general online as far as possible XX:+DisableExplicitGC Parameter disable , If you add this JVM Launch parameters , So the code is called System.gc() No effect
- The guarantee mechanism of space distribution in the old days
Analysis methods
- First , According to the object growth rate in the old age , Come to the conclusion that in theory full GC The frequency of . Compare the theoretical frequency with the actual frequency .
- If the actual frequency is much higher than the theoretical frequency , So according to full gc Than minor gc There are many reasons to analyze what kind of reasons . For example, try to increase the size of meta space 、 Ban System.gc() And avoid triggering the space allocation guarantee mechanism of the elderly generation .
- If the example frequency is not much different from the theoretical frequency , It shows that the problem lies in the object growth rate in the old age . At this point, there are two ways to analyze :
3.1 Consider reducing the rate at which objects enter the old age . Use thread analysis to determine whether a large number of large objects are generated , Whether in the younger generation young GC It triggers the dynamic age determination mechanism to make the object enter the old age .
3.2 Consider increasing the heap size , To reduce full GC frequency .
边栏推荐
- Implementation of easyexcel's function of merging cells with the same content and dynamic title
- Spark 之 Projection
- Nlp-d62-nlp competition d31 & question brushing D15
- 【入门】正则表达式基础入门笔记
- Matlab quickly converts two-dimensional coordinates of images into longitude and latitude coordinates
- 竣达技术丨多品牌精密空调集中监控方案
- 427-二叉树(617.合并二叉树、700.二叉搜索树中的搜索、98. 验证二叉搜索树、530.二叉搜索树的最小绝对差)
- 多线程基础部分Part2
- Using domain name forwarding mqtt protocol, pit avoidance Guide
- Opencv实现对象跟踪
猜你喜欢
随机推荐
Wechat applet refreshes the current page
427- binary tree (617. merge binary tree, 700. search in binary search tree, 98. verify binary search tree, 530. minimum absolute difference of binary search tree)
Webrtc series - Nomination and ice of 7-ice supplement for network transmission_ Model
Software testing year end summary report template
【Cocos Creator 3.5.1】input. Use of on
Proxy-Reflect使用详解
【Cocos Creator 3.5.1】坐标的加法
The SCP command is used in the expect script. The perfect solution to the problem that the SCP command in the expect script cannot obtain the value
使用CSDN 开发云搭建导航网站
Luogu p2939 [usaco09feb]revamping trails G
Run opcua protocol demo on raspberry pie 4B to access kubeedge
Spark's projection
Functional continuous
数据库-索引
Qt使用Valgrind分析内存泄漏
免费的 SSH 和 Telnet 客户端PuTTY
Free SSH and telnet client putty
程序猿学习抖音短视频制作
QT using Valgrind to analyze memory leaks
Two position relay rxmvb2 r251 204 110dc








