RFR: 8339611: GenShen: Simplify ShenandoahOldHeuristics::trigger_collection_if_fragmented [v3]
Kelvin Nilsen
kdnilsen at openjdk.org
Wed Sep 11 03:33:24 UTC 2024
On Tue, 10 Sep 2024 23:54:22 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 558:
>
>> 556: // Our intent is to pack old-gen memory into the highest-numbered regions of the heap. Count all memory
>> 557: // above first_old_region as the "span" of old generation.
>> 558: size_t old_region_span = (first_old_region <= last_old_region)? (num_regions - first_old_region): 0;
>
> Can it ever be the case that `first_old_region > last_old_region` ? When can that be the case?
>
> Then, `old_region_span = 0`....
It happens if there are no old regions, i.e. old-gen is empty. I'll add comments. (first_old_region == num_regions and last_old_region == -1 implies empty)
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/492#discussion_r1753071655
More information about the shenandoah-dev
mailing list