First of all, you need to make sure that it is CPU usage that introduces latency rather than stopping the pause (for example, Full GC if you use CMS).
If full GCs are not a problem, you can check the effective VM flags of your application by running it with all existing flags (existing flags can affect the default values of others), and then add -XX:+PrintFlagsFinal
.
Find ConcGCThreads
and make sure that reducing this number has the desired effect. For parallel loops, it will use fewer cores (but more wall ones).
source
share