RFR: 8373894: G1: Count evacuation-failed garbage collections in gc cpu usage
Thomas Schatzl
tschatzl at openjdk.org
Tue Jan 20 08:04:26 UTC 2026
On Mon, 19 Jan 2026 08:42:07 GMT, Ivan Walulya <iwalulya 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
>
> Nit:
>
> A comment in the PR about the changes in the test would have been helpful.
Thanks @walulyai @kimbarrett for your reviews
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29115#issuecomment-3771540055
More information about the hotspot-gc-dev
mailing list