8260042: G1 Post-cleanup liveness printing occurs too early

Reviewed-by: sjohanss, iwalulya
This commit is contained in:
Thomas Schatzl 2021-01-26 10:14:53 +00:00
parent 23edb6f6b2
commit b4ace3e979
2 changed files with 5 additions and 5 deletions

View File

@ -1331,11 +1331,6 @@ void G1ConcurrentMark::cleanup() {
_g1h->heap_region_iterate(&cl);
}
if (log_is_enabled(Trace, gc, liveness)) {
G1PrintRegionLivenessInfoClosure cl("Post-Cleanup");
_g1h->heap_region_iterate(&cl);
}
verify_during_pause(G1HeapVerifier::G1VerifyCleanup, VerifyOption_G1UsePrevMarking, "Cleanup after");
// We need to make this be a "collection" so any collection pause that

View File

@ -1103,6 +1103,11 @@ void G1Policy::record_concurrent_mark_cleanup_end() {
G1CollectionSetCandidates* candidates = G1CollectionSetChooser::build(_g1h->workers(), _g1h->num_regions());
_collection_set->set_candidates(candidates);
if (log_is_enabled(Trace, gc, liveness)) {
G1PrintRegionLivenessInfoClosure cl("Post-Cleanup");
_g1h->heap_region_iterate(&cl);
}
bool mixed_gc_pending = next_gc_should_be_mixed("request mixed gcs", "request young-only gcs");
if (!mixed_gc_pending) {
clear_collection_set_candidates();