::record_changed_seg ((uint8_t*)region, heap_segment_reserved (region),
settings.gc_index, current_bgc_state,
seg_deleted);
- decommit_mark_array_by_seg (region);
+
+ if (settings.entry_memory_load >= high_memory_load_th || g_low_memory_status)
+ {
+ decommit_mark_array_by_seg (region);
+ }
#endif //BACKGROUND_GC
}
size_t gc_heap::decommit_heap_segment_pages_worker (heap_segment* seg,
uint8_t* new_committed)
{
+#ifdef USE_REGIONS
+ if (settings.entry_memory_load < high_memory_load_th && !g_low_memory_status)
+ {
+ return 0;
+ }
+#endif
assert (!use_large_pages_p);
uint8_t* page_start = align_on_page (new_committed);
size_t size = heap_segment_committed (seg) - page_start;
//decommit all pages except one or 2
void gc_heap::decommit_heap_segment (heap_segment* seg)
{
+#ifdef USE_REGIONS
+ if (settings.entry_memory_load < high_memory_load_th && !g_low_memory_status)
+ {
+ return;
+ }
+#endif
+
uint8_t* page_start = align_on_page (heap_segment_mem (seg));
dprintf (3, ("Decommitting heap segment %Ix(%Ix)", (size_t)seg, heap_segment_mem (seg)));