Show the default value chosen for XX:ParallelGCThreads [duplicate]

僤鯓⒐⒋嵵緔 提交于 2020-01-29 12:49:06

问题


I'm tuning the JVM of Java 8 and I'm trying to know what the value was defined for the parameter -XX:ParallelGCThreads. The documentation says:

-XX:ParallelGCThreads: Sets the number of threads used during parallel phases of the garbage collectors. The default value varies with the platform on which the JVM is running.

I would like to know what value was defined in my platform and if I need to change that. I don't have in this environment a JDK, only JRE.


回答1:


Default value :

 java -XX:+PrintFlagsFinal | grep ParallelGCThreads
 uint  ParallelGCThreads                        = 4

If you have a running process jinfo <processId>, if it's not present in the output, it is using the default value (look under VM Flags)




回答2:


Consider the default is a fixed number N, as in -XX:ParallelGCThreads=<N>

As per the documentation, that number is based on the amount of HW threads your system has:

On a machine with N hardware threads where N is greater than 8, the parallel collector uses a fixed fraction of N as the number of garbage collector threads. The fraction is approximately 5/8 for large values of N. At values of N below 8, the number used is N.



来源:https://stackoverflow.com/questions/46178181/show-the-default-value-chosen-for-xxparallelgcthreads

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