RFR: 8339611: GenShen: Simplify ShenandoahOldHeuristics::trigger_collection_if_fragmented [v3]
Kelvin Nilsen
kdnilsen at openjdk.org
Wed Sep 11 17:35:27 UTC 2024
On Tue, 10 Sep 2024 23:56:01 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Improve comments and clarify intent of old_region_span
>
> src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp line 573:
>
>> 571: size_t old_words_consumed = old_region_count * region_size_words - old_fragmented_available;
>> 572: size_t old_words_spanned = old_region_span * region_size_words;
>> 573: double old_density = ((double) old_words_consumed) / old_words_spanned;
>
> ... and if `old_region_span = 0`, then you end up with line 573 causing a divide-by-zero error.
Good catch. Thanks. I'm restructuring the code to only perform this division if old_span_percent > 0.5. We only compute old_span_percent if ShenandoahGeneratiionalHumongousReserve > 0.
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/492#discussion_r1755218000
More information about the shenandoah-dev
mailing list