RFR: 8212084: G1: Implement UseGCOverheadLimit [v2]
Thomas Schatzl
tschatzl at openjdk.org
Thu Oct 23 11:53:37 UTC 2025
> Hi all,
>
> please review these changes to implement the `UseGCOverheadLimit` functionality for G1 (and make the implementation for Parallel GC have similar output).
>
> The `UseGCOverheadLimit` feature prematurely returns `null` from a GC if GC cpu usage limits and heap usage limits are met for some time. This is to avoid a VM limping along if garbage collection gets into an endless cycle of garbage collections or until a "real" OOME is thrown.
>
> What is important here is how this works (derived from the Parallel GC implementation):
>
> * check overheads at the end of the (initial) garbage collection (before upgrading) to see whether we are over the limits for a sequence of GCs.
> * keep doing GCs without actually allocating memory for the allocation request to keep on measuring gc CPU usage. This is important for measuring the correct cpu usage in case of the application being able to free memory on the OOME.
>
> Testing: tier1-5 without any OOMEs due to this feature, test case
>
> Thanks,
> Thomas
Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
* walulyai review
* fandreuzzi review
* some additional comment tweaks
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27950/files
- new: https://git.openjdk.org/jdk/pull/27950/files/389e5a26..a8663e1b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27950&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27950&range=00-01
Stats: 15 lines in 2 files changed: 2 ins; 2 del; 11 mod
Patch: https://git.openjdk.org/jdk/pull/27950.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27950/head:pull/27950
PR: https://git.openjdk.org/jdk/pull/27950
More information about the hotspot-gc-dev
mailing list