当前位置:网站首页>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 .
边栏推荐
- 426-二叉树(513.找树左下角的值、112. 路径总和、106.从中序与后序遍历序列构造二叉树、654. 最大二叉树)
- Program ape learning Tiktok short video production
- 树莓派4B上运行opcua协议DEMO接入kubeedge
- [FPGA] realize the data output of checkerboard horizontal and vertical gray scale diagram based on bt1120 timing design
- C Primer Plus 第11章_字符串和字符串函数_代码和练习题
- Multithreading basic part2
- 下载cuda和cudnn
- 【QT小记】QT中正则表达式QRegularExpression的基本使用
- 我对于测试团队建设的意见
- JS to implement bidirectional data binding
猜你喜欢

Program ape learning Tiktok short video production

Win 10 如何打开环境变量窗口

Codeforces Round #802 (Div. 2)

免费的 SSH 和 Telnet 客户端PuTTY
![[FPGA] design and implementation of frequency division and doubling based on FPGA](/img/84/75d473d3d8e670260ba16d06705c2f.png)
[FPGA] design and implementation of frequency division and doubling based on FPGA

30 SCM common problems and solutions!

汇编语言-王爽 第8章 数据处理的两个基本问题-笔记

leetcode298周赛记录

Altium Designer 19 器件丝印标号位置批量统一摆放

QT using Valgrind to analyze memory leaks
随机推荐
Multithreading basic part2
LeetCode 0086.分隔链表
多线程基础部分Part3
【Cocos Creator 3.5.1】event.getButton()的使用
洛谷P4683 [IOI2008] Type Printer 题解
汇编语言-王爽 第11章 标志寄存器-笔记
Two position relay rxmvb2 r251 204 110dc
【Cocos Creator 3.5.1】input. Use of on
树莓派4B上运行opcua协议DEMO接入kubeedge
openresty使用文档
洛谷P2939 [USACO09FEB]Revamping Trails G 题解
【Cocos Creator 3.5.1】event. Use of getbutton()
Comprehensive application of OpenCV in contour detection and threshold processing
爬虫学习5---反反爬之识别图片验证码(ddddocr和pytesseract实测效果)
693. 交替位二进制数
Two position relay xjls-8g/220
427-二叉树(617.合并二叉树、700.二叉搜索树中的搜索、98. 验证二叉搜索树、530.二叉搜索树的最小绝对差)
Functional continuous
[FPGA] UART serial port_ V1.1
leetcode299周赛记录