JDK-8153225 : G1 creates too many concurrent refinement threads by default
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2016-03-31
  • Updated: 2023-08-31
  • Resolved: 2022-10-20
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.
Other
tbdResolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
Ever since Concurrent Refinement was parallelized (JDK-6484957), the number of threads created by default (G1ConcRefinementThreads) has been equal to ParallelGCThreads.

I think by default we should scale G1ConcRefinementThreads down by about the same amount as ConcGCThreads are scaled down. On the linux box I'm using this would reduce G1ConcRefinementThreads from 13 down to 2.
Comments
JDK-8190426 changed concurrent refinement to lazily create refinement threads when -XX:+UseDynamicNumberOfGCThreads, but the thread controller still often created lots of threads. The new refinement thread controller from JDK-8294206 usually significantly reduces the number of created threads. As a result of those changes, this isn't a problem anymore.
20-10-2022

Note that JDK-8134889 "Kitchensink stress test crashes with out of memory error" added a hard limit of 16 threads on 32-bit machines. This fixed some silly cases when running a 32-bit JVM on huge 64-bit machines with many CPUs.
18-05-2016

Further discusion is pointing towards a more generous limit for G1ConcRefinementThreads. First need to do some benchmarking (both on normal GC benchmarks and those that generate a lot of concurrent refinement work).
01-04-2016