From 3f048ae07c067563a0ed378d49eead6224b1f6fd Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Fri, 19 Jun 2020 16:59:48 -0700 Subject: [PATCH] Approximate the heap_hard_limit --- src/coreclr/src/gc/gc.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index 35ff30e89502d0..e217e48696cdb4 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -35186,8 +35186,7 @@ HRESULT GCHeap::Initialize() { gc_heap::heap_hard_limit_oh[2] = min_segment_size_hard_limit; } - // This tells the system there is a hard limit, but otherwise we will not compare against this value. - gc_heap::heap_hard_limit = 1; + gc_heap::heap_hard_limit = gc_heap::heap_hard_limit_oh[0] + gc_heap::heap_hard_limit_oh[1] + gc_heap::heap_hard_limit_oh[2]; } else { @@ -35222,8 +35221,7 @@ HRESULT GCHeap::Initialize() { gc_heap::heap_hard_limit_oh[2] = (size_t)(gc_heap::total_physical_mem * (uint64_t)percent_of_mem_poh / (uint64_t)100); } - // This tells the system there is a hard limit, but otherwise we will not compare against this value. - gc_heap::heap_hard_limit = 1; + gc_heap::heap_hard_limit = gc_heap::heap_hard_limit_oh[0] + gc_heap::heap_hard_limit_oh[1] + gc_heap::heap_hard_limit_oh[2]; } }