diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 13a3915f7b68cd..0cc95bca4d3a77 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -12638,6 +12638,11 @@ size_t gc_heap::decommit_heap_segment_pages_worker (heap_segment* seg, void gc_heap::decommit_heap_segment (heap_segment* seg) { #ifdef USE_REGIONS + if (use_large_pages_p) + { + return; + } + if (!dt_high_memory_load_p()) { return; @@ -38001,6 +38006,21 @@ void gc_heap::compact_phase (int condemned_gen_number, recover_saved_pinned_info(); +#ifdef USE_REGIONS + for (int i = 0; i <= min (condemned_gen_number + 1, (int)max_generation); i++) + { + generation* gen = generation_of (i); + for (heap_segment* region = generation_start_segment_rw (gen); + region != nullptr; + region = heap_segment_next_rw (region)) + { + uint8_t* plan_allocated = heap_segment_plan_allocated (region); + if (plan_allocated > heap_segment_used (region)) + heap_segment_used (region) = plan_allocated; + } + } +#endif //USE_REGIONS + concurrent_print_time_delta ("compact end"); dprintf (2, (ThreadStressLog::gcEndCompactMsg(), heap_number));