RFR: 8373894: G1: Count evacuation-failed garbage collections in gc cpu usage

Ivan Walulya iwalulya at openjdk.org
Mon Jan 19 08:45:22 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
> 
> Thanks,
>   Thomas

Nit:

A comment in the PR about the changes in the test would have been helpful.

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

Marked as reviewed by iwalulya (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29115#pullrequestreview-3676922588


More information about the hotspot-gc-dev mailing list