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

Thomas Schatzl tschatzl at openjdk.org
Thu Nov 13 09:36:05 UTC 2025


On Wed, 12 Nov 2025 18:45:38 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   * fix compilation on osx
>
> src/hotspot/share/gc/g1/g1IHOPControl.cpp line 66:
> 
>> 64:                       percent_of(cur_conc_mark_start_threshold, _target_occupancy),
>> 65:                       _target_occupancy,
>> 66:                       occupancy,
> 
> Not sure if I misunderstood this or not -- this two value `_target_occupancy` vs `occupancy` mean sth quite different, one for whole-heap and the other for non-young regions.
> 
> Based on their names, I'd expect them to refer to the same set of regions.

I had a follow-up planned to fix this (and the log message) to something like `non-young occupancy` (or similar).

> src/hotspot/share/gc/g1/g1IHOPControl.cpp line 189:
> 
>> 187: }
>> 188: 
>> 189: void G1AdaptiveIHOPControl::send_jfr_event(G1NewTracer* tracer, size_t occupancy) {
> 
> Why `jfr` in the name? There is nothing related to `jfr` in this context.

Because this is what the method does. Send a JFR/trace event. I think the new name is more concise about that. Similar to the other name that is now called `print_log` to explicitly call out that we are printing the log message.

In Hotspot, a "trace event" or just "event" is always a JFR event as opposed to printing log output.

I can rename it back if you think the old name was more concise. Maybe it is better wrt to the `G1NewTracer` used here.

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

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


More information about the hotspot-gc-dev mailing list