--- old/src/hotspot/share/gc/g1/g1HeapSizingPolicy.hpp 2020-02-17 17:22:56.808265615 +0800 +++ new/src/hotspot/share/gc/g1/g1HeapSizingPolicy.hpp 2020-02-17 17:22:56.810265687 +0800 @@ -45,6 +45,9 @@ double _ratio_over_threshold_sum; uint _pauses_since_start; + // Mininum heap capacity after last concurrent mark + size_t _minimum_desired_bytes_after_last_cm; + protected: G1HeapSizingPolicy(const G1CollectedHeap* g1h, const G1Analytics* analytics); @@ -52,8 +55,12 @@ // 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(); + virtual size_t expansion_amount_after_young_collection(); + virtual size_t expansion_amount_after_concurrent_mark(); + virtual size_t shrink_amount_after_mixed_collections(); + // Calculate the target capacity based on used bytes and free ratio + virtual size_t target_heap_capacity(size_t used_bytes, uintx free_ratio); // Clear ratio tracking data used by expansion_amount(). void clear_ratio_check_data();