JDK-8330671 : Obsolete ScavengeBeforeFullGC
  • Type: CSR
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 23
  • Submitted: 2024-04-19
  • Updated: 2024-07-25
  • Resolved: 2024-04-23
Related Reports
CSR :  
Description
Summary
-------

Obsolete the VM product option `ScavengeBeforeFullGC` due to removal of corresponding functionality.

Problem
-------

The `ScavengeBeforeFullGC` flag executes a (fast) Young GC pause before execution of a Full GC. This groups live objects together so that the Full GC has less work left to do when a reasonable part of the heap is already compacted. Only Parallel GC enables this option by default.

This optimization can be (or was) effective when Parallel GC Full GC was single-threaded and there has been CMS' full gc that has always been executed in serial. At this time, CMS has been removed and Parallel Full GC is always multi-threaded and can handle fragmented heap well. The extra Young GC pause unnecessarily increases total pause time with little gain.

Solution
--------

Remove the functionality and obsolete the VM product option `ScavengeBeforeFullGC` without any deprecation period.

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

```
-  product(bool, ScavengeBeforeFullGC, true,                                 \
-          "Scavenge youngest generation before each full GC.")              \
-                                                                            \
```
Comments
The product flags are considered part of a public "API", so per https://wiki.openjdk.org/display/csr/Fields+of+a+CSR+Request, the scope should be "JDK".
25-07-2024

Moving to Approved for JDK 23.
23-04-2024