RFR: Account for humongous object waste

Y. Srinivas Ramakrishna ysr at openjdk.org
Mon Apr 17 19:02:38 UTC 2023


On Sat, 15 Apr 2023 00:20:20 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp line 359:
>> 
>>> 357:     _committed += r->is_committed() ? ShenandoahHeapRegion::region_size_bytes() : 0;
>>> 358:     if (r->is_humongous()) {
>>> 359:       _humongous_waste += r->free();
>> 
>> Wouldn't this be the case only when `_used > 0` (i.e. the HR is in use and isn't free? Otherwise, is there an implicit assumption of the regions over which this closure is working that wants to appear as an assertion check here?)
>
> I'm not sure I follow. This closure visits every region. We don't want to count the `free` portions of regular/in-use regions as humongous waste.

I see the source of my confusion. A region is designated humongous only when it holds a humongous object (we don't reserve humongous regions a priori). Thus, the test `r->is_humongous` a fortiori implies `r->used() > 0`. Sorry for my confusion. 

I also realize now that this is used only during verification, which I hadn't realized before.

All good.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/255#discussion_r1169162588


More information about the shenandoah-dev mailing list