From b12117107cfc391ffe43266a90bc75257ebf183c Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Thu, 28 Jul 2022 05:57:21 -0700 Subject: [PATCH] Avoid promoting in sweep_in_plan when we already decided not to promote --- src/coreclr/gc/gc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 8774b94f0779a8..47c3b54ad423f1 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -30685,7 +30685,7 @@ bool gc_heap::should_sweep_in_plan (heap_segment* region) sip_p = true; } - if (new_gen_num < max_generation) + if (settings.promotion && (new_gen_num < max_generation)) { int old_card_surv_ratio = (int)(((double)heap_segment_old_card_survived (region) * 100.0) / (double)basic_region_size);