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

8268390: G1 concurrent gc upgrade to full gc not working #4435

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1915,16 +1915,6 @@ bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
}
}

bool G1CollectedHeap::should_upgrade_to_full_gc(GCCause::Cause cause) {
if (should_do_concurrent_full_gc(_gc_cause)) {
return false;
} else if (has_regions_left_for_allocation()) {
return false;
} else {
return true;
}
}

#ifndef PRODUCT
void G1CollectedHeap::allocate_dummy_regions() {
// Let's fill up most of the region
@@ -285,9 +285,6 @@ class G1CollectedHeap : public CollectedHeap {
uint gc_counter,
uint old_marking_started_before);

// Return true if should upgrade to full gc after an incremental one.
bool should_upgrade_to_full_gc(GCCause::Cause cause);

// indicates whether we are in young or mixed GC mode
G1CollectorState _collector_state;

@@ -1089,9 +1086,10 @@ class G1CollectedHeap : public CollectedHeap {
return _hrm.available() == 0;
}

// Returns whether there are any regions left in the heap for allocation.
bool has_regions_left_for_allocation() const {
return !is_maximal_no_gc() || num_free_regions() != 0;
// Returns true if an incremental GC should be upgrade to a full gc. This
// is done when there are no free regions and the heap can't be expanded.
bool should_upgrade_to_full_gc() const {
return is_maximal_no_gc() && num_free_regions() == 0;
}

// The current number of regions in the heap.
@@ -100,7 +100,7 @@ void VM_G1TryInitiateConcMark::doit() {
// makes a later _gc_locker collection needed. (Else we would have hit
// the GCLocker check in the prologue.)
_transient_failure = true;
} else if (g1h->should_upgrade_to_full_gc(_gc_cause)) {
} else if (g1h->should_upgrade_to_full_gc()) {
_gc_succeeded = g1h->upgrade_to_full_collection();
} else {
_gc_succeeded = true;
@@ -150,7 +150,7 @@ void VM_G1CollectForAllocation::doit() {
// An allocation had been requested. Do it, eventually trying a stronger
// kind of GC.
_result = g1h->satisfy_failed_allocation(_word_size, &_gc_succeeded);
} else if (g1h->should_upgrade_to_full_gc(_gc_cause)) {
} else if (g1h->should_upgrade_to_full_gc()) {
// There has been a request to perform a GC to free some space. We have no
// information on how much memory has been asked for. In case there are
// absolutely no regions left to allocate into, do a full compaction.