RFR: 8378293: GenShen: Simplify selection of aged regions

William Kemper wkemper at openjdk.org
Wed Feb 25 11:01:38 UTC 2026


On Tue, 24 Feb 2026 15:45:32 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> Aged regions with a sufficient amount of live data may be promoted in place. Other aged regions with insufficient live data may have their objects evacuated by promotion. These regions bypass normal collection set selection. For historical reasons, this process used an intermediate array to pass these regions between components. After recent refactorings, this array is no longer necessary and other simplifications can be made.
>> 
>> There aren't meant to be any behavior changes in this PR. The main change here is that instead of using  a separate array for preselected regions, we just put them straight in the collection set. This change also no longer forces an evacuation/update-refs cycle when we _only_ have in-place-promotions (these can be done by an abbreviated cycle).
>
> src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp line 294:
> 
>> 292:       }
>> 293:     } else if (region->is_trash()) {
>> 294:       // Count in just trashed humongous continuation regions
> 
> This comment is a bit unclear to me.  Same "confusing" comment shows up in shenandoahHeuristics.cpp.  Maybe I'm just not "parsing" the sentence in the intended way.  Not a big deal...

It's meant to compliment the preceding comment:
```C++
         heap->trash_humongous_region_at(region);

        // Count only the start. Continuations would be counted on "trash" path

Trashing the humongous start region trashes all the continuation regions too. This comment on `294` is meant to explain how the rest of the humongous regions are counted as immediate garbage.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29832#discussion_r2850067300


More information about the shenandoah-dev mailing list