diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 934cfb0da730b2..26233d54eba2ac 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -38191,7 +38191,8 @@ size_t gc_heap::trim_youngest_desired (uint32_t memory_load, } else { - return max (mem_one_percent, total_min_allocation); + size_t total_max_allocation = max (mem_one_percent, total_min_allocation); + return min (total_new_allocation, total_max_allocation); } }