Avoid promoting in sweep_in_plan when we already decided not to promote (#72998)
authorAndrew Au <andrewau@microsoft.com>
Thu, 28 Jul 2022 19:52:19 +0000 (12:52 -0700)
committerGitHub <noreply@github.com>
Thu, 28 Jul 2022 19:52:19 +0000 (12:52 -0700)
src/coreclr/gc/gc.cpp

index cd93843..e860430 100644 (file)
@@ -30688,7 +30688,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);