7.19.10 -XX:ParallelGCThreads
-XX:ParallelGCThreads specifies the number of threads that can execute G1GC in parallel.
Description
-XX:ParallelGCThreads specifies the number of threads that can execute G1GC in parallel. This option is enabled when -XX:+UseG1GC is specified. We recommend that you use the default value for this option. However, if you want to change the value, set an appropriate value calculated based on the value measured during actual Java VM operation.
When Java VM starts, the number of GC threads specified in this option is created, and then processing is executed.
If 0 is specified for this option, the default value is set.
When specifying this option, note the following points:
-
If you specify 1, parallel execution will be performed for a single thread, resulting in a decrease in execution performance.
-
If you specify a value that exceeds the number of threads that can be created in the execution environment, Java VM will not be able to start, because the creation of GC threads during Java VM startup will fail.
-
If the specified value is outside of the valid range, a message is output to the standard output, and Java VM terminates with the return code 1.
-
For G1GC, if you increase the value of this option, the number of Evacuation processing threads will increase. As a result, the resources allocated to Evacuation processing might increase and throughput might decrease. If you change the value of this option, verify that performance requirements are met.
Syntax
-XX:ParallelGCThreads=value
Default value
- If the definition item is omitted:
-
- If the number of logical CPUs in the execution environment is 8 or less:
-
-XX:ParallelGCThreads=number_of_CPUs
- If the number of logical CPUs in the execution environment is 9 or more:
-
-XX:ParallelGCThreads=(8 + (number_of_CPUs - 8)*(5 / 8))#
- #:
-
The calculated value is rounded down to the nearest integer.
For example, when the number of logical CPUs is 4, the default value is 4: ParallelGCThreads = 4. Similarly, when the number of logical CPUs is 72, the default value is 48: ParallelGCThreads = 8 + (72 - 8)*(5 / 8) = 48.