8319713: Parallel: Remove PSAdaptiveSizePolicy::should_full_GC

Reviewed-by: tschatzl, sjohanss
This commit is contained in:
Albert Mingkun Yang 2023-11-28 10:40:14 +00:00
parent 99f870c43f
commit 4bcda60266
3 changed files with 1 additions and 24 deletions

@ -169,22 +169,6 @@ void PSAdaptiveSizePolicy::major_collection_end(size_t amount_live,
_major_timer.start();
}
// If the remaining free space in the old generation is less that
// that expected to be needed by the next collection, do a full
// collection now.
bool PSAdaptiveSizePolicy::should_full_GC(size_t old_free_in_bytes) {
// A similar test is done in the scavenge's should_attempt_scavenge(). If
// this is changed, decide if that test should also be changed.
bool result = padded_average_promoted_in_bytes() > (float) old_free_in_bytes;
log_trace(gc, ergo)("%s after scavenge average_promoted " SIZE_FORMAT " padded_average_promoted " SIZE_FORMAT " free in old gen " SIZE_FORMAT,
result ? "Full" : "No full",
(size_t) average_promoted_in_bytes(),
(size_t) padded_average_promoted_in_bytes(),
old_free_in_bytes);
return result;
}
void PSAdaptiveSizePolicy::clear_generation_free_space_flags() {
AdaptiveSizePolicy::clear_generation_free_space_flags();

@ -306,10 +306,6 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy {
}
double major_collection_slope() { return _major_collection_estimator->slope();}
// Given the amount of live data in the heap, should we
// perform a Full GC?
bool should_full_GC(size_t live_in_old_gen);
// Calculates optimal (free) space sizes for both the young and old
// generations. Stores results in _eden_size and _promo_size.
// Takes current used space in all generations as input, as well

@ -239,8 +239,7 @@ bool PSScavenge::invoke() {
IsGCActiveMark mark;
const bool scavenge_done = PSScavenge::invoke_no_policy();
const bool need_full_gc = !scavenge_done ||
policy->should_full_GC(heap->old_gen()->free_in_bytes());
const bool need_full_gc = !scavenge_done;
bool full_gc_done = false;
if (UsePerfData) {
@ -703,8 +702,6 @@ bool PSScavenge::should_attempt_scavenge() {
// Test to see if the scavenge will likely fail.
PSAdaptiveSizePolicy* policy = heap->size_policy();
// A similar test is done in the policy's should_full_GC(). If this is
// changed, decide if that test should also be changed.
size_t avg_promoted = (size_t) policy->padded_average_promoted_in_bytes();
size_t promotion_estimate = MIN2(avg_promoted, young_gen->used_in_bytes());
bool result = promotion_estimate < old_gen->free_in_bytes();