G1GC long pause with initial-mark

会有一股神秘感。 提交于 2019-12-05 19:56:45

for logging, use -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime for better understanding of the problem and bottlenecks

Its recommended to use -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:+UseCompressedOops options with G1GC (if these are supported by native machine/server & JDK version)

Also please use -XX:GCPauseIntervalMillis=VALUE with the combination of -XX:MaxGCPauseMillis=VALUE (It'll control your pauses, better to get combination of best fit values of both params by doing some R&D) BTW we are successfully using combination of values as -XX:MaxGCPauseMillis=400 -XX:GCPauseIntervalMillis=8000

The default value of -XX:NewRatio param is 40, so its better to have it either 40 or more than 40 e.g. -XX:NewRatio=50

Ravindra babu

The G1 GC is an adaptive garbage collector with defaults that enable it to work efficiently without modification. Refer to below question for more details.

Java 7 (JDK 7) garbage collection and documentation on G1

If you follow above recommendations recommended by oracle:

  1. Remove below parameters

    -XX:SurvivorRatio=10 
    
  2. MaxGCPauseMillis=40 is too much aggressive compared to default value of 200 ms. Have a reasonable pause time goal.

  3. Change -XX:ParallelGCThreads=14 -XX:ConcGCThreads=4 as per recommendation depending on number of CPU cores in your server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!