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

8309265: Serial: Remove the code related to GC overheap limit #14258

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
31 changes: 3 additions & 28 deletions src/hotspot/share/gc/shared/genCollectedHeap.cpp
Original file line number Diff line number Diff line change
@@ -278,12 +278,7 @@ HeapWord* GenCollectedHeap::expand_heap_and_allocate(size_t size, bool is_tlab
}

HeapWord* GenCollectedHeap::mem_allocate_work(size_t size,
bool is_tlab,
bool* gc_overhead_limit_was_exceeded) {
// In general gc_overhead_limit_was_exceeded should be false so
// set it so here and reset it to true only if the gc time
// limit is being exceeded as checked below.
*gc_overhead_limit_was_exceeded = false;
bool is_tlab) {

HeapWord* result = nullptr;

@@ -365,23 +360,6 @@ HeapWord* GenCollectedHeap::mem_allocate_work(size_t size,
continue; // Retry and/or stall as necessary.
}

// Allocation has failed and a collection
// has been done. If the gc time limit was exceeded the
// this time, return null so that an out-of-memory
// will be thrown. Clear gc_overhead_limit_exceeded
// so that the overhead exceeded does not persist.

const bool limit_exceeded = size_policy()->gc_overhead_limit_exceeded();
const bool softrefs_clear = soft_ref_policy()->all_soft_refs_clear();

if (limit_exceeded && softrefs_clear) {
*gc_overhead_limit_was_exceeded = true;
size_policy()->set_gc_overhead_limit_exceeded(false);
if (op.result() != nullptr) {
CollectedHeap::fill_with_object(op.result(), size);
}
return nullptr;
}
assert(result == nullptr || is_in_reserved(result),
"result not in heap");
return result;
@@ -418,8 +396,7 @@ HeapWord* GenCollectedHeap::attempt_allocation(size_t size,
HeapWord* GenCollectedHeap::mem_allocate(size_t size,
bool* gc_overhead_limit_was_exceeded) {
return mem_allocate_work(size,
false /* is_tlab */,
gc_overhead_limit_was_exceeded);
false /* is_tlab */);
}

bool GenCollectedHeap::must_clear_all_soft_refs() {
@@ -935,10 +912,8 @@ size_t GenCollectedHeap::unsafe_max_tlab_alloc(Thread* thr) const {
HeapWord* GenCollectedHeap::allocate_new_tlab(size_t min_size,
size_t requested_size,
size_t* actual_size) {
bool gc_overhead_limit_was_exceeded;
HeapWord* result = mem_allocate_work(requested_size /* size */,
true /* is_tlab */,
&gc_overhead_limit_was_exceeded);
true /* is_tlab */);
if (result != nullptr) {
*actual_size = requested_size;
}
3 changes: 1 addition & 2 deletions src/hotspot/share/gc/shared/genCollectedHeap.hpp
Original file line number Diff line number Diff line change
@@ -376,8 +376,7 @@ class GenCollectedHeap : public CollectedHeap {
HeapWord* expand_heap_and_allocate(size_t size, bool is_tlab);

HeapWord* mem_allocate_work(size_t size,
bool is_tlab,
bool* gc_overhead_limit_was_exceeded);
bool is_tlab);

#if INCLUDE_SERIALGC
// For use by mark-sweep. As implemented, mark-sweep-compact is global