--- old/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2020-02-19 11:43:06.759410682 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2020-02-19 11:43:06.353397998 +0100 @@ -76,6 +76,7 @@ class Space; class G1CardTableEntryClosure; class G1CollectionSet; +class G1HeapSizingPolicy; class G1Policy; class G1HotCardCache; class G1RemSet; @@ -565,7 +566,7 @@ return _g1mm; } - void resize_heap_if_necessary(); + void resize_heap_after_full_gc(); G1NUMA* numa() const { return _numa; } @@ -782,13 +783,17 @@ // Evacuate the next set of optional regions. void evacuate_next_optional_regions(G1ParScanThreadStateSet* per_thread_states); + bool expand_heap_after_young_collection(); + void shrink_heap_after_young_collection(); + public: void pre_evacuate_collection_set(G1EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* pss); void post_evacuate_collection_set(G1EvacuationInfo& evacuation_info, G1RedirtyCardsQueueSet* rdcqs, G1ParScanThreadStateSet* pss); - void expand_heap_after_young_collection(); + void resize_heap_after_young_collection(); + // Update object copying statistics. void record_obj_copy_mem_stats(); @@ -990,6 +995,7 @@ const G1CollectorState* collector_state() const { return &_collector_state; } G1CollectorState* collector_state() { return &_collector_state; } + G1HeapSizingPolicy* heap_sizing_policy() const { return _heap_sizing_policy; } // The current policy object for the collector. G1Policy* policy() const { return _policy; } // The remembered set. @@ -1085,7 +1091,7 @@ inline void archive_set_add(HeapRegion* hr); - size_t non_young_capacity_bytes() { + size_t non_young_capacity_bytes() const { return (old_regions_count() + _archive_set.length() + humongous_regions_count()) * HeapRegion::GrainBytes; } @@ -1287,6 +1293,9 @@ // Return the size of reserved memory. Returns different value than max_capacity() when AllocateOldGenAt is used. virtual size_t max_reserved_capacity() const; + // Print the soft maximum heap capacity. + size_t soft_max_capacity() const; + virtual jlong millis_since_last_gc();