Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8309538: G1: Move total collection increment from Cleanup to Remark #14334

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
Original file line number Diff line number Diff line change
@@ -1295,6 +1295,11 @@ void G1ConcurrentMark::remark() {
ClassLoaderDataGraph::purge(/*at_safepoint*/true);
}

// Potentially, some empty-regions have been reclaimed; make this a
// "collection" so that pending allocation can retry before attempting a
// GC pause.
_g1h->increment_total_collections();

_g1h->resize_heap_if_necessary();
_g1h->uncommit_regions_if_necessary();

@@ -1462,10 +1467,6 @@ void G1ConcurrentMark::cleanup() {

verify_during_pause(G1HeapVerifier::G1VerifyCleanup, VerifyLocation::CleanupAfter);

// We need to make this be a "collection" so any collection pause that
// races with it goes around and waits for Cleanup to finish.
_g1h->increment_total_collections();

// Local statistics
double recent_cleanup_time = (os::elapsedTime() - start);
_total_cleanup_time += recent_cleanup_time;