We use the G1ParPreserveCMReferentsTask GangTask for that, always executing it using all threads but then internally let some threads just do nothing if there is not enough work to do.
The problem with that method is, if you are on a large machine with tens of threads, and there is almost nothing to do during this phase (or even during the whole GC), starting up and waiting for that many threads takes a very significant fraction of gc pause time, e.g. half of object copy time.
A much better way would be to determine the number of required threads at the outside, and only start up as many threads as required.
Test case: GCOld
- duplicates
-
JDK-8201492 Properly implement non-contiguous generations for Reference discovery
- Resolved
-
JDK-8076180 Remove space.inline.hpp from heapRegion.hpp
- Closed
-
JDK-8076463 Add logging for the preserve CM referents task
- Closed
- relates to
-
JDK-8076584 G1: Parallelism used for redirty logged cards needs better control
- Closed
-
JDK-8043575 Dynamically parallelize reference processing work
- Resolved
-
JDK-8172792 JEP 308: Improve Dynamic Number of Thread Sizing for G1
- Closed
-
JDK-8076463 Add logging for the preserve CM referents task
- Closed