RFR: 8325673: GenShen: Share Reserves between Old and Young Collector [v2]
Kelvin Nilsen
kdnilsen at openjdk.org
Mon Jul 15 14:29:43 UTC 2024
> Allow young-gen Collector reserve to share memory with old-gen Collector reserve in order to support prompt processing of mixed evacuations, as constrained by ShenandoahOldEvacRatioPercent.
Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 70 commits:
- Remove unreferenced local variable
- Fix whitespace
- Remove debug instrumentation and deprecated code
- Turn off instrumentation
- Verifier should only count non-trashed committed regions
- Ignore generation soft capacities when adjusting generation sizes
Soft capacities are established, for example, by setting NewRatio or New size on the
JVM command line. GenShen, for now at least, does not honor these settings. Better
performance is obtained by allowing GenShen to expand and shrink generation sizes
according to application behavior.
This commit also tidies up various aspects of the implementation to make adjustments
to generation sizing more consistent:
1. ShenandoahGlobalHeuristics::choose_global_collection_set(): share the reserves
between young and old collection to maximize evacuation of garbage-first
regions, regardless of whether most garbage is found in old or young
2. ShenandoahConcurrentGC::entry_final_roots(): do not balance generations before
invoking finish_rebuild() because finish_rebuild will balance generations.
3. ShenandoahFreeSet::flip_to_old_gc(): invoke force_transfer_to_young() instead
of transfer_to_young() so we can override soft-capacity limits
4. ShenandoahFullGC::phase5_epilog(): Do not invoke compute_balances() or
balance_generations_after_rebuilding_free_set(). Allow the free-set
rebuild() implementation to do this work in a more consistent fashion.
5. ShenandoahGeneration::adjust_evacuation_budgets(): replace transfer_to_youn()
with force_transfer_to_young() to avoid enforcement of soft capacity limits.
6. ShenandoahGenerationSizer::force_transfer_to_young(): new method
7. ShenandoahGenerationalFullGC::balance_generations_after_gc(): establish
reserves() so that free-set rebuild() can adjust balance. Do not redundantly
force transfer of regions here.
8. ShenandoahGenerationalFullGC::balance_generations_after_rebuilding_free_set():
deprecate this method.
9. ShenandoahGenerationalFullGC::compute_balances(): deprecate this method.
10. ShenandoahGenerationaStatsClosure::validate_usage() (part of Shenandoah
Verification): add consistency check for generation capacities
- Fix budgeting error during freeset rebuild
Limit the size of old-gen by memory available in the OldCollector set
following find_regions_with_alloc_capacity() (rather than limiting the
size of old-gen by the total capacity of the OldCollector set, which
includes used memory).
- Fix whitespace
- Merge remote-tracking branch 'origin/master' into share-collector-reserves
- Merge branch 'openjdk:master' into master
- ... and 60 more: https://git.openjdk.org/shenandoah/compare/d2102347...33eacea7
-------------
Changes: https://git.openjdk.org/shenandoah/pull/395/files
Webrev: https://webrevs.openjdk.org/?repo=shenandoah&pr=395&range=01
Stats: 1318 lines in 23 files changed: 832 ins; 240 del; 246 mod
Patch: https://git.openjdk.org/shenandoah/pull/395.diff
Fetch: git fetch https://git.openjdk.org/shenandoah.git pull/395/head:pull/395
PR: https://git.openjdk.org/shenandoah/pull/395
More information about the shenandoah-dev
mailing list