From 4acf20df7b4729dbf1b6fbab8a94d84c76437031 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 27 Mar 2023 08:17:43 +0000 Subject: [PATCH] 8304809: Remove develop flag G1ExitOnExpansionFailure Reviewed-by: ayang, kbarrett --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 21 ++++++--------------- src/hotspot/share/gc/g1/g1_globals.hpp | 4 ---- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 48617450c8b..4e249e3e2de 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -1255,22 +1255,13 @@ bool G1CollectedHeap::expand(size_t expand_bytes, WorkerThreads* pretouch_worker *expand_time_ms = (os::elapsedTime() - expand_heap_start_time_sec) * MILLIUNITS; } - if (expanded_by > 0) { - size_t actual_expand_bytes = expanded_by * HeapRegion::GrainBytes; - assert(actual_expand_bytes <= aligned_expand_bytes, "post-condition"); - policy()->record_new_heap_size(num_regions()); - } else { - log_debug(gc, ergo, heap)("Did not expand the heap (heap expansion operation failed)"); + assert(expanded_by > 0, "must have failed during commit."); - // The expansion of the virtual storage space was unsuccessful. - // Let's see if it was because we ran out of swap. - if (G1ExitOnExpansionFailure && - _hrm.available() >= regions_to_expand) { - // We had head room... - vm_exit_out_of_memory(aligned_expand_bytes, OOM_MMAP_ERROR, "G1 heap expansion"); - } - } - return expanded_by > 0; + size_t actual_expand_bytes = expanded_by * HeapRegion::GrainBytes; + assert(actual_expand_bytes <= aligned_expand_bytes, "post-condition"); + policy()->record_new_heap_size(num_regions()); + + return true; } bool G1CollectedHeap::expand_single_region(uint node_index) { diff --git a/src/hotspot/share/gc/g1/g1_globals.hpp b/src/hotspot/share/gc/g1/g1_globals.hpp index 2ec1637ac4f..78b4fc27e1f 100644 --- a/src/hotspot/share/gc/g1/g1_globals.hpp +++ b/src/hotspot/share/gc/g1/g1_globals.hpp @@ -236,10 +236,6 @@ develop(bool, G1VerifyCTCleanup, false, \ "Verify card table cleanup.") \ \ - develop(bool, G1ExitOnExpansionFailure, false, \ - "Raise a fatal VM exit out of memory failure in the event " \ - " that heap expansion fails due to running out of swap.") \ - \ product(uintx, G1MaxNewSizePercent, 60, EXPERIMENTAL, \ "Percentage (0-100) of the heap size to use as default " \ " maximum young gen size.") \