Auto-detection of number of parallel GC threads
For failover/stability and also to avoid synchronization/gc impacts, we start multiple JVMs to run our business application on an application server.
Recently when we were doing a benchmark with JDK1.5.0_05, we noticed unusually long minor GC times and high CPU usage on the box. Turns out the box has 20 CPUs and when we start 5 JVMs on the box there is too much activity from those threads (we were just using -Xmx1024m)
By adding -XX:ParallelGCThreads=4, everything came back to normal.
I have several questions related to this:
1. Are there any JVM options to make it detect other JVMs running and adjust ParallelGCThreads automatically?
2. If not, are there plans to add such an option?
3. What would be a reasonable formula for deciding ParallelGCThreads? Something like (#CPU / #JVM)?