8309265: Serial: Remove the code related to GC overheap limit
Reviewed-by: ayang, tschatzl
This commit is contained in:
parent
61bb014a86
commit
6edd786bf6
@ -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;
|
||||
}
|
||||
|
@ -376,8 +376,7 @@ private:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user