-XX:ConcGCThreads sets how many threads the JVM uses for concurrent background garbage-collection work. Tuning it helps balance cleanup progress against CPU available to the application. section 11.4.4
Use GC logs to investigate whether garbage collection is underusing or overusing CPU:
- Check frequent or long GC events for signs that cleanup work needs more parallelism. section 11.4.4
- Compare workers used with workers available; underutilization can contribute to inefficient memory management and longer pauses. section 11.4.4
- Change concurrent and parallel GC thread settings cautiously: too few threads can prolong cleanup, while too many can consume application CPU. section 11.4.4 section 11.5
Reading a GC worker count
A log showing “Workers: 2 (out of 8 available)” indicates that cleanup is using only part of the available worker capacity. Pairing -XX:ConcGCThreads with -XX:ParallelGCThreads settings gives the JVM explicit GC parallelism choices to test.
