JEP draft: Deprecate the combination of the Parallel Scavenge and Serial Old garbage collection algorithms

OwnerThomas Schatzl
TypeFeature
ScopeImplementation
StatusDraft
Componenthotspot / gc
EffortXS
DurationXS
Reviewed byErik Helin, Kim Barrett, Stefan Karlsson
Created2019/08/13 18:07
Updated2019/10/01 12:15
Issue8229492

Summary

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

Non-Goals

Motivation

The Oracle garbage collection team regularly assesses the cost and benefits of maintaining existing garbage collection algorithms for OpenJDK. There is one combination of garbage collection algorithms that we believe is very little used while requiring significant amount of maintenance resources: the pairing of the parallel young generation garbage collector (called ParallelScavenge) and the serial old garbage collector (called SerialOld). This garbage collector combination must be specifically enabled by the user with the -XX:+UseParallelGC -XX:-UseParallelOldGC command line options.

This combination is unusual as it pairs parallel young generation and serial old generation garbage collection 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 garbage collection algorithm for both the young and old generation 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 garbage collector combination.

Description

Next to the flag combination -XX:+UseParallelGC -XX:-UseParallelOldGC we also deprecate the -XX:UseParallelOldGC flag since its only use is to deselect the parallel old generation garbage collector (thereby enabling the serial old generation garbage collector) as UseParallelOldGC has already been true by default since introduction.

This results in any explicit use of the UseParallelOldGC option to print a deprecation warning. In particular, a warning will also be printed when -XX:+UseParallelOldGC is used standalone (without -XX:+UseParallelGC) to select the parallel young and old generation garbage collection algorithms.

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

Alternatives

The only change is the deprecation message and no loss of functionality. The existing garbage collector called "Parallel" (combining parallel young generation and parallel old generation garbage collection 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 garbage collector combination. If there are still a significant amount of users of this garbage collector combination, deprecation may be reconsidered.