当前位置:网站首页>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 .
边栏推荐
猜你喜欢

Watermaker of the Flink core

flutter 系列之:flutter 中常用的 GridView layout 详解

高考失利进哈工大,毕业却留校要当“探索者”,丁效:科研就是厚积薄发

Setup and upload of arduino-esp32 flash file plug-in program

go template with...end遍历用法

从pdb源码到frame帧对象

在线JSON转PlainText工具

移动Web实训DAY-1

Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform

投资98万美元的Saas项目失败了
随机推荐
Align content attribute in flex layout
投资98万美元的Saas项目失败了
Mysql database literacy, do you really know what a database is
全志V853芯片 如何在Tina V85x平台切换sensor?
完全背包 初学篇「建议收藏」
List集合转数组
pytorch模型
You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration property
From jsonpath and XPath to spl
Complete backpack beginner chapter "suggestions collection"
在线JSON转PlainText工具
电脑无线网络不显示网络列表应该如何解决
腾讯确认QQ大规模盗号,iPhone14无缘Type-C,第四大运营商5G正式放号,今日更多大新闻在此...
plt.savefig()的用法以及保存路径
Flutter series part: detailed explanation of GridView layout commonly used in flutter
从pdb源码到frame帧对象
Mysq 8.0 launched histogram, which greatly improved the performance!
PHP obtains the beginning and end time of the month according to the month and year
You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration property
The difference between align items and align content