RFR: 8274178: G1: Occupancy value in IHOP logging and JFR event is inaccurate

Albert Mingkun Yang ayang at openjdk.org
Fri Nov 7 12:04:14 UTC 2025


On Thu, 6 Nov 2025 10:33:46 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this change that modifies heap occupancy reporting for IHOP to use the actual occupancy value the IHOP calculation actually uses.
> 
> I.e. previously IHOP logging used to report `G1CollectedHeap::used()` as occupancy (which is correct at a general level), but for IHOP/marking that value is not interesting, but the "occupancy" value used for comparing against the current heap occupancy threshold.
> 
> Testing: tier1-3, GHA
> 
> Thomas

src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 357:

> 355:     return humongous_obj_size_in_regions(allocation_word_size) * G1HeapRegion::GrainBytes;
> 356:   } else {
> 357:     return allocation_word_size;

Shouldn't this be converted to bytes?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28175#discussion_r2503117680


More information about the hotspot-gc-dev mailing list