JDK-8359925 : Deprecate and obsolete ParallelRefProcEnabled
  • Type: CSR
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 26
  • Submitted: 2025-06-18
  • Updated: 2025-06-20
  • Resolved: 2025-06-20
Related Reports
CSR :  
Relates :  
Description
Summary
-------
Deprecate the `ParallelRefProcEnabled` flag in JDK 26 and obsolete it in JDK 27, then remove in JDK 28.

Problem
-------

`ParallelRefProcEnabled` incurs some implementation complexity in reference processing. There is no benefit in disabling this flag as automatic dynamic thread number selection will automatically determine the best number of threads to use per type of references, from all available parallel threads down to using only a single thread.

This flag is used only by Parallel and G1, and both have it enabled by default via:

```
  if (FLAG_IS_DEFAULT(ParallelRefProcEnabled) && ParallelGCThreads > 1) {
    FLAG_SET_DEFAULT(ParallelRefProcEnabled, true);
  }
```

Solution
--------

Deprecate the `ParallelRefProcEnabled` flag in JDK 26 and obsolete it in JDK 27, then remove in JDK 28.

Specification
-------------

```
   product(bool, ParallelRefProcEnabled, false,                              \
-          "Enable parallel reference processing whenever possible")         \
+          "(Deprecated) Enable parallel reference processing "              \
+          "whenever possible")                                              \
```
Comments
Moving to Approved.
20-06-2025

Added the relevant source code that sets the default value of this flag.
19-06-2025

Moving to Provisional, not Approved. [~ayang], the Problem section implies the parallel processing has been occurring by default, but the source snippet implies the parallel processing is disabled. Can you clarify?
18-06-2025