# HG changeset patch # User tschatzl # Parent 77f4adb486be72c96d82e39c28c61d55b40829d7 diff -r 77f4adb486be -r 21c1ddd204f9 src/hotspot/share/gc/g1/g1CollectedHeap.cpp --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Thu Jun 25 16:37:08 2020 +0200 +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Thu Jun 25 16:37:37 2020 +0200 @@ -1035,7 +1035,8 @@ assert(num_free_regions() == 0, "we should not have added any free regions"); rebuild_region_sets(false /* free_list_only */); abort_refinement(); - resize_heap_if_necessary(); + + resize_heap_after_full_collection(); // Rebuild the strong code root lists for each region rebuild_strong_code_roots(); @@ -1140,7 +1141,7 @@ clear_all_soft_refs); } -void G1CollectedHeap::resize_heap_if_necessary() { +void G1CollectedHeap::resize_heap_after_full_collection() { assert_at_safepoint_on_vm_thread(); // Capacity, free and used after the GC counted as full regions to diff -r 77f4adb486be -r 21c1ddd204f9 src/hotspot/share/gc/g1/g1CollectedHeap.hpp --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp Thu Jun 25 16:37:08 2020 +0200 +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp Thu Jun 25 16:37:37 2020 +0200 @@ -573,7 +573,7 @@ return _g1mm; } - void resize_heap_if_necessary(); + void resize_heap_after_full_collection(); G1NUMA* numa() const { return _numa; } @@ -1095,7 +1095,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; } diff -r 77f4adb486be -r 21c1ddd204f9 src/hotspot/share/gc/g1/g1ConcurrentMark.cpp --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp Thu Jun 25 16:37:08 2020 +0200 +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp Thu Jun 25 16:37:37 2020 +0200 @@ -1146,8 +1146,6 @@ ClassLoaderDataGraph::purge(); } - _g1h->resize_heap_if_necessary(); - compute_new_sizes(); verify_during_pause(G1HeapVerifier::G1VerifyRemark, VerifyOption_G1UsePrevMarking, "Remark after");