--- old/src/hotspot/share/gc/g1/g1HeapSizingPolicy.hpp 2020-02-25 15:41:44.400057775 +0800 +++ new/src/hotspot/share/gc/g1/g1HeapSizingPolicy.hpp 2020-02-25 15:41:44.402057847 +0800 @@ -45,15 +45,19 @@ double _ratio_over_threshold_sum; uint _pauses_since_start; - -protected: G1HeapSizingPolicy(const G1CollectedHeap* g1h, const G1Analytics* analytics); + public: // If an expansion would be appropriate, because recent GC overhead had // exceeded the desired limit, return an amount to expand by. - virtual size_t expansion_amount(); + size_t expansion_amount_after_young_collection(); + + size_t shrink_amount_at_last_mixed_gc(size_t desired_bytes_after_concurrent_mark); + size_t shrink_amount_after_concurrent_mark(); + // Calculate the target capacity based on used bytes and free ratio + size_t target_heap_capacity(size_t used_bytes, uintx free_ratio) const; // Clear ratio tracking data used by expansion_amount(). void clear_ratio_check_data();