Better default for ParallelGCThreads and ConcGCThreads by using number of physical cores and CPU mask.

David Keenan dkeenan at
Tue Nov 19 23:54:44 UTC 2013

Could you detail the workloads used to measure the reduction in CPU time?
 Vagueness is ok. The magnitude of the improvement albeit wonderful is
surprising.  I'm curious whether system load was a factor in measurement.

On Tue, Nov 19, 2013 at 3:35 PM, Jungwoo Ha <jwha at> wrote:

> Hi,
> I am sending this webrev for the review.
> (On behalf of Jon Masamitsu, it is upload here)
> The feature is a new heuristics to calculate the default ParallelGCThreads
> and ConGCThreads.
> In x86, hyperthreading is generally bad for GC because of the cache
> contention.
> Hence, using all the hyper-threaded cores will slow down the overall GC
> performance.
> Current hotspot reads the number of processors that the Linux reports,
> which treats all hyper-threaded cores equally.
> Second problem is that when cpu mask is set, not all the cores are
> available for the GC.
> The patch improves the heuristics by evaluating the actual available
> physical cores
> from the proc filesystem and the CPU mask, and use that as the basis for
> calculating the ParallelGCThreads and ConcGCThreads.
> The improvements of GC pause time is significant. We evaluated on Nehalem,
> Westmere, Sandybridge as well as several AMD processors. We also evaluated
> on various CPU mask configuration and single/dual socket configurations.
> In almost all cases, there were speed up in GC pause time by 10~50%.
> We primarily use CMS collector for the evaluation, but we also tested on
> other GCs as well.
> Please take a look and let me know if this patch can be accepted.
> Thanks,
> Jungwoo Ha




dkeenan at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the hotspot-gc-dev mailing list