RFR: Account for humongous object waste

Y. Srinivas Ramakrishna ysr at openjdk.org
Fri Apr 14 23:30:05 UTC 2023


On Thu, 13 Apr 2023 22:37:54 GMT, William Kemper <wkemper at openjdk.org> wrote:

> The unused portion of the last region in a humongous object is now tracked and logged.

LGTM. (left a few questions that could help w/clarifying documentation of the "waste" statistic.)

src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 55:

> 53:   // Usage
> 54:   size_t _affiliated_region_count;
> 55:   size_t _humongous_waste;      // how much waste for padding in humongous objects

Could you document here whether this is included in `_used` below, or is explicitly excluded from it. From my cursory reading of the code doing the adjustments, it looked like `_used` includes `_humongous_waste`.

it would also be good to include a line of documentation about where this statistic might be useful (or, if it is, where it is used today).

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?)

src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp line 425:

> 423: 
> 424:     if (!generation->is_global()) {
> 425:       // Humongous waste is currently only tracked for young and old generations

Why?

(May be this gets back to my question about where and how this statistic is being used or being planned to be used.)

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

Marked as reviewed by ysr (Author).

PR Review: https://git.openjdk.org/shenandoah/pull/255#pullrequestreview-1386255262
PR Review Comment: https://git.openjdk.org/shenandoah/pull/255#discussion_r1167328412
PR Review Comment: https://git.openjdk.org/shenandoah/pull/255#discussion_r1167329472
PR Review Comment: https://git.openjdk.org/shenandoah/pull/255#discussion_r1167330018


More information about the shenandoah-dev mailing list