Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Don't compact LOH just because a heap_hard_limit exists #23366

Merged
1 commit merged into from Mar 22, 2019
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
8 changes: 4 additions & 4 deletions src/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5854,7 +5854,7 @@ void gc_mechanisms::init_mechanisms()
promotion = FALSE;//TRUE;
compaction = TRUE;
#ifdef FEATURE_LOH_COMPACTION
loh_compaction = gc_heap::should_compact_loh();
loh_compaction = gc_heap::loh_compaction_requested();
#else
loh_compaction = FALSE;
#endif //FEATURE_LOH_COMPACTION
Expand Down Expand Up @@ -21365,10 +21365,10 @@ uint8_t* gc_heap::loh_allocate_in_condemned (uint8_t* old_loc, size_t size)
}
}

BOOL gc_heap::should_compact_loh()
BOOL gc_heap::loh_compaction_requested()
{
// If hard limit is specified GC will automatically decide if LOH needs to be compacted.
return (heap_hard_limit || loh_compaction_always_p || (loh_compaction_mode != loh_compaction_default));
return (loh_compaction_always_p || (loh_compaction_mode != loh_compaction_default));
}

inline
Expand Down Expand Up @@ -21538,7 +21538,7 @@ BOOL gc_heap::plan_loh()

void gc_heap::compact_loh()
{
assert (should_compact_loh());
assert (loh_compaction_requested() || heap_hard_limit);

generation* gen = large_object_generation;
heap_segment* start_seg = heap_segment_rw (generation_start_segment (gen));
Expand Down
2 changes: 1 addition & 1 deletion src/gc/gcpriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2223,7 +2223,7 @@ class gc_heap
BOOL loh_object_p (uint8_t* o);

PER_HEAP_ISOLATED
BOOL should_compact_loh();
BOOL loh_compaction_requested();

// If the LOH compaction mode is just to compact once,
// we need to see if we should reset it back to not compact.
Expand Down