8381549: GenShen: Global collections skip coalesce and fill when the collection set is empty

Reviewed-by: kdnilsen, xpeng, ysr
This commit is contained in:
William Kemper 2026-04-03 21:04:52 +00:00
parent a333111bd8
commit f21e47db80
3 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
// Choose the collection set
filter_regions(collection_set);
if (!collection_set->is_empty() && _generation->is_global()) {
if (_generation->is_global()) {
// We have just chosen a collection set for a global cycle. The mark bitmap covering old regions is complete, so
// the remembered set scan can use that to avoid walking into garbage. When the next old mark begins, we will
// use the mark bitmap to make the old regions parsable by coalescing and filling any unmarked objects. Thus,
@ -94,7 +94,7 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
// coalesce those regions. Only the old regions which are not part of the collection set at this point are
// eligible for coalescing. As implemented now, this has the side effect of possibly initiating mixed-evacuations
// after a global cycle for old regions that were not included in this collection set.
heap->old_generation()->prepare_for_mixed_collections_after_global_gc();
heap->old_generation()->transition_old_generation_after_global_gc();
}
}

View File

@ -685,7 +685,7 @@ void ShenandoahOldGeneration::abandon_collection_candidates() {
_old_heuristics->abandon_collection_candidates();
}
void ShenandoahOldGeneration::prepare_for_mixed_collections_after_global_gc() {
void ShenandoahOldGeneration::transition_old_generation_after_global_gc() {
assert(is_mark_complete(), "Expected old generation mark to be complete after global cycle.");
_old_heuristics->prepare_for_old_collections();
log_info(gc, ergo)("After choosing global collection set, mixed candidates: " UINT32_FORMAT ", coalescing candidates: %zu",

View File

@ -213,7 +213,7 @@ public:
bool is_concurrent_mark_in_progress() override;
bool entry_coalesce_and_fill();
void prepare_for_mixed_collections_after_global_gc();
void transition_old_generation_after_global_gc();
void prepare_gc() override;
void prepare_regions_and_collection_set(bool concurrent) override;
void record_success_concurrent(bool abbreviated) override;