RFR: 8339611: GenShen: Simplify ShenandoahOldHeuristics::trigger_collection_if_fragmented [v3]
Y. Srinivas Ramakrishna
ysr at openjdk.org
Wed Sep 11 20:44:33 UTC 2024
On Wed, 11 Sep 2024 17:32:50 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
>> 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.
Yes, that should fix the issue. Just ping me for a re-review when that is completed. Thanks!
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/492#discussion_r1755574909
More information about the shenandoah-dev
mailing list