RFR: DRAFT: Expand old on demand [v15]
Kelvin Nilsen
kdnilsen at openjdk.org
Mon Apr 17 19:34:11 UTC 2023
> This PR describes several proposed changes to dynamically adjust the sizes of old-gen and young-gen. In general, the objective is to keep old-gen as small as possible so that there is an abundance of memory available for the young-gen allocation runway.
>
> As currently drafted, there are regression failures. This DRAFT PR is published for the purpose of facilitating a careful code review.
Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 92 commits:
- Merge remote-tracking branch 'origin' into expand-old-on-demand
- Fix whitespace errors
- Fix my fix for overwriting update_watermark in promote_in_place
I wasn't careful enough to assure that I did not introduce another
assertion error with my previous "fix".
- Overwrite update_water_mark in ShenandoahHeapRegion::promote_in_place
While a region waits to be promoted in place, its value of top equals
end. This is a temporary arrangement, to prevent young-gen objects
from being allocated within this region before it is promoted. Once
the region is promoted, its value of top() is adjusted to its previous
value. The region's update_watermark value was likely set when the
region had its artificially high value of top. So we fix it here.
- Degen GC needs to evacuate even if cset is empty in some cases
In particular, when there are humongous or regular regions to be promoted
in place, we still need to "evacuate", because the evacuation phase takes
responsibility for registering objects and building the remembered set.
- Refine generational assertions for full-gc mode
Certain assertions are not valid in full gc mode because full gc does not
necessarily maintain all invariants during the STW pause. By the time
full gc finishes, all invariants should be restored, and they are checked
then.
- Do not verify usage accounting at start of Full GC
If we degenerate to full in the middle of evacuation, usage accounts are in limbo.
- Remove unreferenced variable
- Fixup whitespace and comments
- Remove infrastructure to adjust generation capacities for loans from old
A previous mechanism would loan memory from old to young during the
evacuation and update-refs phases of GC. This approach had limited
value because the loans had to be repaid immediately upon completion of
the update-refs phase. A newer approach dynamically adjusts the size of
old generation, consistently keeping it as small as possible. This
allows the maximum amount of allocation to be performed between
consecutive young-gc efforts.
- ... and 82 more: https://git.openjdk.org/shenandoah/compare/7df41365...4bb56495
-------------
Changes: https://git.openjdk.org/shenandoah/pull/248/files
Webrev: https://webrevs.openjdk.org/?repo=shenandoah&pr=248&range=14
Stats: 3287 lines in 35 files changed: 1859 ins; 882 del; 546 mod
Patch: https://git.openjdk.org/shenandoah/pull/248.diff
Fetch: git fetch https://git.openjdk.org/shenandoah.git pull/248/head:pull/248
PR: https://git.openjdk.org/shenandoah/pull/248
More information about the shenandoah-dev
mailing list