欢迎来到 JVM 参数MarkStackSize
的讨论专区
参数名称
MarkStackSize
取值类型
unsigned int
参数说明
Size of marking stack
用法及建议
- 使用该参数的正确姿势是-XX:MarkStackSize=___
默认值
平台/版本 | JDK6 | JDK7 | JDK8 |
---|---|---|---|
Linux | 4194304 | 4194304 | 4194304 |
MacOS | 4194304 | 4194304 | 4194304 |
Windows | 4194304 | 4194304 | 4194304 |
GC concurrent-mark-reset-for-overflow
: This indicates that the global marking stack had became full and there was an overflow of the stack. Concurrent marking detected this overflow and had to reset the data structures to start the marking again
So increasing -XX:MarkStackSize
is one quick win.
Few observation from your VM parameters:
- The G1 GC is an adaptive garbage collector with defaults that enable it to work efficiently without modification. Have a quick look at oracle documentation page on G1GC
- Key parameters to set :
-XX:MaxGCPauseMillis, -XX:G1HeapRegionSize,-XX:ParallelGCThreads=n, -XX:ConcGCThreads=n
Leave everything else to default values. - If your heap size is 16 GB, the ideal region size should be
8 MB
. Make sure that you maintain2048
regions. - Revisit your pause time goal.
-XX:MaxGCPauseMillis
. If200ms
is unrealistic for 16 GB heap, set this value as properly. - Official documentation page recommends the way to set
XX:ParallelGCThreads=n, -XX:ConcGCThreads=n
depending on number of cores in your machine.-XX:ParallelGCThreads=n
: Sets the value of the STW worker threads. Sets the value of n to the number of logical processors. The value of n is the same as the number of logical processors up to a value of 8.-XX:ConcGCThreads=n
:Sets the number of parallel marking threads. Sets n to approximately 1/4 of the number of parallel garbage collection threads (ParallelGCThreads). - Revisit
-XX:InitialHeapSize=17179869184 -XX:InitiatingHeapOccupancyPercent=45 -XX:G1ReservePercent=20
parameters. Leave them to default values unless you have pressing need to change them.