--- old/src/hotspot/share/gc/g1/g1IHOPControl.cpp 2020-02-12 17:18:33.299507525 +0800 +++ new/src/hotspot/share/gc/g1/g1IHOPControl.cpp 2020-02-12 17:18:33.301507597 +0800 @@ -108,7 +108,7 @@ double safe_total_heap_percentage = MIN2((double)(_heap_reserve_percent + _heap_waste_percent), 100.0); return (size_t)MIN2( - G1CollectedHeap::heap()->max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0, + G1CollectedHeap::heap()->soft_max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0, _target_occupancy * (100.0 - _heap_waste_percent) / 100.0 ); } @@ -187,3 +187,8 @@ predict(&_marking_times_s), have_enough_data_for_prediction()); } + +size_t G1AdaptiveIHOPControl::predict_unstrained_buffer_size() const { + // Besides the young size, the promotion bytes of Prepare Mixed and 1st Mixed GC will be counted + return _last_unrestrained_young_size + _last_allocated_bytes * 2; +}