Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3255,6 +3255,12 @@ gc_heap::dt_low_card_table_efficiency_p (gc_tuning_point tp)
return ret;
}

inline BOOL
gc_heap::dt_high_memory_load_p()
{
return ((settings.entry_memory_load >= high_memory_load_th) || g_low_memory_status);
}

inline BOOL
in_range_for_segment(uint8_t* add, heap_segment* seg)
{
Expand Down Expand Up @@ -10917,7 +10923,7 @@ void gc_heap::clear_region_info (heap_segment* region)
settings.gc_index, current_bgc_state,
seg_deleted);

if (settings.entry_memory_load >= high_memory_load_th || g_low_memory_status)
if (dt_high_memory_load_p())
{
decommit_mark_array_by_seg (region);
}
Expand Down Expand Up @@ -11376,7 +11382,7 @@ 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)
if (!dt_high_memory_load_p())
{
return 0;
}
Expand Down Expand Up @@ -11411,7 +11417,7 @@ 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 (settings.entry_memory_load < high_memory_load_th && !g_low_memory_status)
if (!dt_high_memory_load_p())
{
return;
}
Expand Down Expand Up @@ -39354,7 +39360,7 @@ void reset_memory (uint8_t* o, size_t sizeo)
size_t size = align_lower_page ((size_t)o + sizeo - size_to_skip - plug_skew) - page_start;
// Note we need to compensate for an OS bug here. This bug would cause the MEM_RESET to fail
// on write watched memory.
if (reset_mm_p && gc_heap::g_low_memory_status)
if (reset_mm_p && gc_heap::dt_high_memory_load_p())
{
#ifdef MULTIPLE_HEAPS
bool unlock_p = true;
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/gc/gcpriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -4962,6 +4962,9 @@ class gc_heap
PER_HEAP_ISOLATED
size_t exponential_smoothing (int gen, size_t collection_count, size_t desired_per_heap);

PER_HEAP_ISOLATED
BOOL dt_high_memory_load_p();

protected:
PER_HEAP
void update_collection_counts ();
Expand Down