JDK-8047976 : Ergonomics for GC thread counts should update the flags
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 8u20,9
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-06-24
  • Updated: 2015-06-03
  • Resolved: 2014-09-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b35Fixed
Related Reports
Relates :  
Description
There are a set of options indicating counts for the various GC thread types. If these valuse are set to zero (default), the values are determined ergonomically.

However, unlike the same mechanism in ParallelGCThreads, the ConcGCThreads and G1ConcRefinementThreads values are never updated and always shows up as zero when running with -XX:+PrintFlagsFinal

E.g. when running "java -XX:+PrintFlagsFinal -version" on a 32 thread machine, the output is

ParallelGCThreads       = 23
ConcGCThreads          = 0
G1ConcRefinementThreads = 0

but expected is

ParallelGCThreads      := 23
ConcGCThreads         := 6
G1ConcRefinementThreads := 23 (or whatever value determined ergonomically)


Comments
It's okay for Parallel and CMS too after looking at it again. The "problem" has been that Parallel/CMS do not update flags they do not use like described in an earlier comment.
05-11-2014

As Thomas and I have found out, this is fixed for G1, but not for Parallel GC or CMS.
05-11-2014

Stanley, As you already know, this patch is already backported to 8u40. http://hg.openjdk.java.net/jdk8u/hs-dev/hotspot/rev/8ba0078861d4
02-10-2014

Any plan to back port this to 8u40 (or 8u20)?
27-09-2014

The problematic options seem to be ParallelGCThreads and G1ConcRefinementThreads that are not always updated properly. G1ConcRefinementThreads is not updated if - there is no value set (using the default) - G1 is invoked with G1ConcRefinementThreads := 0 For ParallelGCThreads, the count is only not updated if set to zero manually. I think this should be fixed in JDK-6979279 though.
25-09-2014

For several GC modes here's current values for 24 threads: (ParallelGCThreads / ConcGCThreads / G1ConcRefinementThreads) 1. Parallel GC: 18 / 0(*) / 0(*) 2. CMS GC: 18 / 5 / 0(*) 3. ParNew GC: 18 / 0(*) / 0(*) 4. G1 GC: 18 / 5 / 0(should be fixed) * Some GC modes doesn't update if the variable is not related. So the fix should be to update G1ConcRefinementThreads to be 18. And if these variables are not set by commandline they will: ParallelGCThreads = 8 + (thread-8)*5/8 ConcGCThreads = (thread+2)/4 G1ConcRefinementThreads = ParallelGCThreads
24-09-2014