跳到主要内容

JEP 366: Deprecate the ParallelScavenge + SerialOld GC Combination

Summary

Deprecate the combination of the Parallel Scavenge and Serial Old garbage collection algorithms.

Non-Goals

  • It is not a goal to remove this GC combination.

  • It is not a goal to deprecate any other GC combinations.

Motivation

There is one combination of GC algorithms that we believe is very little used but requires a significant amount of maintenance effort: The pairing of the parallel young generation GC (called ParallelScavenge) and the serial old GC (called SerialOld). This combination must be specifically enabled by the user with the -XX:+UseParallelGC -XX:-UseParallelOldGC command line options.

This combination is unusual since it pairs the parallel young generation and serial old generation GC algorithms. We think this combination is only useful for deployments with a very large young generation and a very small old generation. In this scenario the full collection pause times might be bearable due to the small size of the old generation. In practice this is a very rare and risky deployment, since a slight shift in liveness for objects in the young generation will result in an OutOfMemoryException, since the old generation is significantly smaller than the young generation. The only advantage of this combination compared to using a parallel GC algorithm for both the young and old generations is slightly lower total memory usage. We believe that this small memory footprint advantage (at most ~3% of the Java heap size) is not enough to outweigh the costs of maintaining this GC combination.

Description

In addition to deprecating the option combination -XX:+UseParallelGC -XX:-UseParallelOldGC we will also deprecate the option -XX:UseParallelOldGC, since its only use is to deselect the parallel old generation GC, thereby enabling the serial old generation GC.

As a result, any explicit use of the UseParallelOldGC option will display a deprecation warning. A warning will, in particular, be displayed when -XX:+UseParallelOldGC is used standalone (without -XX:+UseParallelGC) to select the parallel young and old generation GC algorithms.

The only way to select the parallel young and old generation GC algorithms without a deprecation warning will to specify only -XX:+UseParallelGC on the command line.

Alternatives

The only change is the deprecation message; there is no loss of functionality. The existing collector called "Parallel", which combines the parallel young generation and parallel old generation algorithms, has almost the same behavior and should be a drop-in replacement.

Risks and Assumptions

We assume that there are very few users of this GC combination. If there are still a significant number of users of this combination, deprecation may be reconsidered.