当前位置:网站首页>G1 important configuration parameters and their default values in the garbage collector
G1 important configuration parameters and their default values in the garbage collector
2022-06-28 13:12:00 【Code Marathon】
-XX:MaxGCPauseMillis
Expected maximum GC Pause time , The default is :200ms.
Be careful :G1 The default policy for is to expect a balance between throughput and latency , So if you want to get higher throughput , Then you can reduce GC The frequency of pauses , And less GC The main way to increase the pause frequency is to increase the maximum GC Pause time .
-XX:GCPauseTimeInterval
The target of the maximum pause interval .
By default ,G1 Don't set any goals , allow G1 In extreme cases, garbage collection is performed continuously .
-XX:ParallelGCThreads
Maximum number of threads used for parallel work during garbage collection pauses .
By default, it runs according to JVM The number of threads available on the computer determines , Calculation method : When the process is available CPU The number of threads is less than or equal to 8 when , Then use this number directly , otherwise , Set to :8 + (n - 8) * (5/8)
.
At each pause , The maximum number of threads used also needs to consider the maximum heap limit , The parameter :-XX:HeapSizePerGCThread
.
-XX:ConcGCThreads
Maximum number of threads for concurrent work , By default , This value is :-XX:ParallelGCThreads Divide 4.
If you want to be able to complete concurrent markup faster , You can appropriately increase the number of threads marked concurrently .
-XX:+G1UseAdaptiveIHOP
Use adaptive IHOP.
Initiating Heap Occupancy Percent( Threshold to trigger concurrent start collection ),G1 Automatically determine the best by observing how long the tag takes and how much memory is usually allocated to older generations during the tag cycle IHOP, This feature is called adaptation IHOP.
If this function is enabled , be G1 Will use -XX:InitiatingHeapOccupancyPercent=45
The value of is used as the threshold for concurrent startup collection .
If G1 There is no good prediction , The age occupancy rate that triggers the concurrency flag , It is recommended to disable :-XX:-G1UseAdaptiveIHOP
, And self adjust -XX:InitiatingHeapOccupancyPercent
The threshold of .
-XX:G1HeapRegionSize
G1 Each one of them Region Size .
The default is based on the maximum heap size , Divided by 2048 individual region To calculate each region Size , The maximum value determined according to ergonomics is 32M, The user-defined range is 1~512M, And it must be 2 The power of .
-XX:G1NewSizePercent、-XX:G1MaxNewSizePercent
The size of heap memory occupied by the new generation , For the initial -XX:G1NewSizePercent
Set the value of the , The default is :5%,G1 The proportion will be adjusted according to the value satisfying the pause time , But not more than -XX:G1MaxNewSizePercent
Set the value of the , The default is :60%.
-XX:G1HeapWastePercent
For more efficient garbage collection ,G1 From Collection Set Choose to free some memory space gain greater region, One of the references is that the recoverable space should be larger than XX:G1HeapWastePercent
Set the value of the , The default is :5%, Represents the current heap space 5%.
-XX:G1MixedGCCountTarget
In the mixed recycling phase ,G1 Expect to maximize the recycling , But it also needs to be considered XX:MaxGCPauseTimeMillis
, Therefore, a large mixture is usually recycled , Split into multiple , This number is determined by XX:G1MixedGCCountTarget
decision , The default is :8 Time , This reduces the pause time for each hybrid recycle , In order to achieve XX:MaxGCPauseTimeMillis
The target value .
-XX:G1MixedGCLiveThresholdPercent
In the mixed recycling phase , Avoid recycling things that take a lot of time to process region, So if the identification needs a lot of time to process ? So in most cases , High occupancy region It takes more time to deal with ,XX:G1MixedGCLiveThresholdPercent
This is the threshold value set for the occupancy rate of living objects , The default is :85%, That is, if one region The proportion of surviving objects in the total population reaches this re-XX:GCPauseTimeInterval= < ERG >gion Of 85%, Then this will not be recycled region.
Be careful : The following three parameters , By default, it is determined in an ergonomic way according to the environment
-XX:GCPauseTimeInterval
-XX:ParallelGCThreads
-XX:ConcGCThreads
Ergonomics : Ergonomics is Java virtual machine (JVM) And garbage collection heuristics ( Such as behavior based heuristics ) The process of improving application performance .
边栏推荐
- Mature case and source code of hash quiz game system development technology
- 5A同步整流芯片 20V转12V2A/5V4.5A大电流 24W大功率同步整流芯片 大电流降压IC FS2462
- 电脑无线网络不显示网络列表应该如何解决
- Microservice stability guarantee
- 移动Web实训-flex布局测试题1
- Mobile web training -flex layout test question 1
- An idea plug-in that automatically generates unit tests, which improves the development efficiency by more than 70%!
- Go language learning notes - Gorm usage - database configuration, table addition | web framework gin (VII)
- pytorch模型
- 高考失利进哈工大,毕业却留校要当“探索者”,丁效:科研就是厚积薄发
猜你喜欢
2. 01背包问题
全志V853芯片 如何在Tina V85x平台切换sensor?
Go language learning notes - Gorm usage - database configuration, table addition | web framework gin (VII)
##测试bug常用“Redmine”
Embedded development: seven techniques for estimating battery life
PHP crawls web pages for specific information
Align content attribute in flex layout
fastposter v2.8.4 发布 电商海报生成器
Understand leveldb write operation
Mysql database literacy, do you really know what a database is
随机推荐
Customize MySQL connection pool
895. 最长上升子序列
async-validator. JS data verifier
Mobile web training day-2
##测试bug常用“Redmine”
开源项目维权成功案例: Spug 开源运维平台成功维权
Can ArcGIS Pro directly connect PostgreSQL and edit layer elements
manjaro easyconnecy报错:libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
From jsonpath and XPath to spl
flink核心之watermarker
海思35xx实现GT911触摸屏功能「建议收藏」
List集合转数组
[MySQL from introduction to mastery] [advanced part] (III) creation of MySQL users_ Modification_ Delete and password settings
plt. Usage of savefig() and save path
June 28, 2022 Daily: Lecun's latest paper: the road to autonomous machine intelligence
flutter 系列之:flutter 中常用的 GridView layout 详解
async-validator.js數據校驗器
Vscode shortcut key
Performance test-01-introduction
Mobile web training -flex layout test question 1