Search code examples
javajvmg1gc

What is the difference between G1GC options -XX:ParallelGCThreads vs -XX:ConcGCThreads


When configuring the G1GC we have two kinds of thread count:

-XX:ParallelGCThreads and -XX:ConcGCThreads.

What is the difference? How they are going to impact? Any reference is appreciated.


Solution

  • G1 algorithm has phases which some of them are "stop the world" phases that stops the application during garbage collection, and it also has phases which happens concurrently while application is running(candidate marking etc..), with that information in mind:

    ParallelGCThreads option affects the number of threads used for phases when application threads are stopped, and the ConcGCThreads flag affects the number of threads used for concurrent phases.