欢迎来到 JVM 参数
Size of marking stack
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
-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=nLeave everything else to default values.
- If your heap size is 16 GB, the ideal region size should be
8 MB. Make sure that you maintain
- Revisit your pause time goal.
200msis unrealistic for 16 GB heap, set this value as properly.
- Official documentation page recommends the way to set
XX:ParallelGCThreads=n, -XX:ConcGCThreads=ndepending 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).
-XX:InitialHeapSize=17179869184 -XX:InitiatingHeapOccupancyPercent=45 -XX:G1ReservePercent=20parameters. Leave them to default values unless you have pressing need to change them.