RFR: Mixed evacuation [v4]
Roman Kennke
rkennke at openjdk.java.net
Fri Apr 16 14:18:58 UTC 2021
On Thu, 15 Apr 2021 17:40:24 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
>> This code adds to generational Shenandoah the ability to perform concurrent garbage collection of young-gen and old-gen memory. Following completion of an old-gen concurrent marking effort, we select certain old-gen heap regions to serve as candidates for future collection sets. All dead objects within the old-gen heap regions that are not part of this candidate set are coalesced and filled so that remembered-set scanning of these old-gen heap regions will not be confused by "zombie objects" (objects that old-gen has decided are dead, which reside in regions that have not yet been collected). After concurrently coalescing and filling these dead objects, each subsequent young-gen evacuation pass includes a subset of the old-gen candidates until all candidates have been collected. This code passes TIER1 and hotspot-gc-shenandoah jtreg tests without regressions. A new jtreg test has been added to exercise concurrent old/young GC.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
>
> Refactor choose_collection_set
>
> Divide the implementation of ShenandoahHeuristic::choose_colection_set() into
> prepare_for_other_collection() and prime_collection_set_with_old_candiates() as
> requested by reviewer of draft pull request. The resulting code passes TIER1 and
> hotspot_gc_shenandoah jtreg regressions and runs additional generational shenandoah
> stress tests.
I am thinking about how to better design the heuristics so to avoid pollution of every single heuristic with a reference to (possibly non-existing) old-gen heuristic. How about this:
- In the base ShenandoahHeuristic add a virtual and empty prime_collection_set() that is called where the block if (_old_heuristics != NULL) { prime_collection_set_with_old_candidates(); } is now.
- Leave all heuristics untouched and also don't introduce a new reference _old_heuristics. Instead:
- Add a new heuristic e.g. ShenandoahGenerationalHeuristic that has pointers to two other heuristics: one for each new-gen and old-gen. Override all relevant methods to delegate to new-gen-heuristics, and implement prime_collection_set() to implement what you're proposing here already. In other words, this heuristic would be mostly composite of old and new gen heuristic.
-------------
PR: https://git.openjdk.java.net/shenandoah/pull/29
More information about the shenandoah-dev
mailing list