跳到主要内容

JEP 214: Remove GC Combinations Deprecated in JDK 8

Summary

Remove the GC combinations that were previously deprecated in JDK 8 via JEP 173.

Non-Goals

It is not a goal of this work to implement replacements for the removed GC combinations. For the most part the remaining collectors should perform as well or better than the removed GC combinations. It is not a goal of this work to enhance any of the garbage collectors to perform as well as the garbage collectors being removed. Only tuning of the garbage collectors will be considered as part of satisfying the performance goal.

Success Metrics

  • No deprecation messages are printed for the concerned JVM options. Instead the JVM considers them to be unknown flags.

  • The performance impact of changing from ParNew + SerialOld to ParallelScavenge + SerialOld is well understood for a reasonable set of benchmarks.

Motivation

As described in JEP 173 there is a large maintenance cost associated with keeping all of the existing GC combinations around. Removing the deprecated GC combinations will allow for many simplifications in the HotSpot GC code, which in turn will reduce the number of bugs and allow for more rapid development of the remaining GC combinations.

Description

The flags to control the GC combinations listed as deprecated in JEP 173, as well as the flags to enable the CMS foreground collector (deprecated as part of JDK-8027876) will be removed from the code base. This means that no warning messages will be printed for them any longer; the JVM will, instead, not start if these flags are used.

Once the flags have been removed then any code that is now dead will be removed for the GC code base. There may be simplifications in the code base that are possible to do because of this work but large in scope. Such simplifications may be separated out as separate changes.

Here is a detailed summary of the flags and flag combinations that will stop working:

DefNew + CMS       : -XX:-UseParNewGC -XX:+UseConcMarkSweepGC
ParNew + SerialOld : -XX:+UseParNewGC
ParNew + iCMS : -Xincgc
ParNew + iCMS : -XX:+CMSIncrementalMode -XX:+UseConcMarkSweepGC
DefNew + iCMS : -XX:+CMSIncrementalMode -XX:+UseConcMarkSweepGC -XX:-UseParNewGC
CMS foreground : -XX:+UseCMSCompactAtFullCollection
CMS foreground : -XX:+CMSFullGCsBeforeCompaction
CMS foreground : -XX:+UseCMSCollectionPassing

For the ParNew + SerialOld combination the work for this JEP will also include performance testing comparing ParNew + SerialOld with ParallelScavenge + SerialOld. This should result in tuning suggestions for migrating from ParNew + SerialOld to ParallelScavenge + SerialOld.

Alternatives

Keep all or some of the deprecated options in the code. This would prevent significant cleanup work in the GC code and slow down new development in the code base.

Testing

There are current tests that verify that the listed options print warning messages. These tests need to be updated to expect messages that the options are unknown.

Risks and Assumptions

Users who are using any of the flags that are being removed will have to update their JVM-startup command lines. If they are moving from JDK 8 to JDK 9 then they will already have seen warning messages and thus should not be surprised. The assumption is that most users will benefit from changing from the flags that are being removed to more modern GC tuning.

Dependences

This work depends on JEP 173: Retire Some Rarely-Used GC Combinations. That JEP was implemented in JDK 8, so there are no outstanding dependencies left at this time.