RFR: 8373894: G1: Count evacuation-failed garbage collections in gc cpu usage
Kim Barrett
kbarrett at openjdk.org
Mon Jan 19 19:13:38 UTC 2026
On Thu, 8 Jan 2026 13:51:24 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> Hi all,
>
> please review this change that makes evacuation failed garbage collections count in the gc CPU usage calculations.
>
> The reason is that currently (since forever), G1 considers garbage collections that experience an evacuation failure to not count in the cpu usage calculations.
>
> (Afair this has been introduced because the previously extremely slow evacuation failures would impact cpu usage based calculations too much even if very infrequent. For many releases evacuation failure handling is at least parallel and in the same order of magnitude wrt to performance).
>
> This can cause significant distortions in GC behavior.
>
> In the worst case, if for some reason all garbage collections experience evacuation failure, gc cpu usage (at least for the young gen evacuation pauses) is considered as (close to) zero, with repercussions on heap sizing.
>
> Testing: tier1-5 multiple times to find tests that fail because of the UseGCOverheadLimit flag and fix them adding `-XX:-UseGCOverheadLimit`
>
> Thanks,
> Thomas
Looks good.
-------------
Marked as reviewed by kbarrett (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/29115#pullrequestreview-3679307237
More information about the hotspot-gc-dev
mailing list