RFR: 8274178: G1: Occupancy value in IHOP logging and JFR event is inaccurate [v2]
Ivan Walulya
iwalulya at openjdk.org
Tue Nov 11 12:49:04 UTC 2025
On Fri, 7 Nov 2025 14:32:38 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
>
> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
>
> * ayang review, missing conversion of word size to byte size
Changes requested by iwalulya (Reviewer).
src/hotspot/share/gc/g1/g1Policy.cpp line 746:
> 744: }
> 745:
> 746: size_t G1Policy::conc_mark_occupancy(size_t allocation_word_size) const {
is `old_gen_occupancy` a more appropriate name? Or a name that explicitly states that this is occupancy of the "non young regions".
src/hotspot/share/gc/g1/g1Policy.hpp line 63:
> 61: static G1IHOPControl* create_ihop_control(const G1OldGenAllocationTracker* old_gen_alloc_tracker,
> 62: const G1Predictions* predictor);
> 63: // Update the IHOP control with necessary statistics. Returns true if there
Suggestion:
// Update the IHOP control with the necessary statistics. Returns true if there
src/hotspot/share/gc/g1/g1Policy.hpp line 311:
> 309:
> 310: private:
> 311: // The current occupancy relevant to concurrent marking, that is compared to
The comment does not make it any more clearer what this is. "Which occupancy is relevant for concurrent marking?"
-------------
PR Review: https://git.openjdk.org/jdk/pull/28175#pullrequestreview-3447538309
PR Review Comment: https://git.openjdk.org/jdk/pull/28175#discussion_r2514105727
PR Review Comment: https://git.openjdk.org/jdk/pull/28175#discussion_r2513822821
PR Review Comment: https://git.openjdk.org/jdk/pull/28175#discussion_r2514111220
More information about the hotspot-gc-dev
mailing list