RFR: 8293861: G1: Disable preventive GCs by default

Thomas Schatzl tschatzl at openjdk.org
Fri Sep 16 12:12:19 UTC 2022


Hi all,

  can I get reviews for this change that disables preventive collections by default?

[JDK-8257774](https://bugs.openjdk.org/browse/JDK-8257774) added "preventive" garbage collections in G1: speculative garbage collections added to avoid costly evacuation failures due to allocation bursts filling up the heap quickly.

These preventive garbage collections have some issues: the main issue is that it's an additional gc:

* object aging is based on number of gcs, so additional gcs cause premature promotion
* more promotion means more mixed gc phases
* additional, potentially unnecessary gc pause

This is somewhat compounded by that the current prediction to trigger preventive garbage collections is very conservative, triggering preventive garbage collections too often and too early.

As we have gathered experience with this feature, we found that in many cases it is a net loss - particularly since its introduction the reason for existing, evacuation failures, got extremely fast (e.g. [JDK-8256265](https://bugs.openjdk.org/browse/JDK-8256265)).

At this point the suggestion is to disable this feature by default. In the future it might be completely removed.

Since this is a diagnostic option, there is no CSR required. There will be a release note for this change.

Testing: tier1, made sure that no test expects preventive gcs

Thanks,
  Thomas

-------------

Commit messages:
 - inital version

Changes: https://git.openjdk.org/jdk/pull/10304/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10304&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8293861
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/10304.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10304/head:pull/10304

PR: https://git.openjdk.org/jdk/pull/10304



More information about the hotspot-gc-dev mailing list