Skip to content

Commit

Permalink
Make sure we compact the LOH when aggressive GC is requested (dotnet#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung authored and matouskozak committed Apr 30, 2024
1 parent 076d3f2 commit 6cc44d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20825,6 +20825,12 @@ int gc_heap::joined_generation_to_condemn (BOOL should_evaluate_elevation,
}
}

if (settings.reason == reason_induced_aggressive)
{
gc_data_global.gen_to_condemn_reasons.set_condition (gen_joined_aggressive);
settings.loh_compaction = TRUE;
}

#ifdef BGC_SERVO_TUNING
if (bgc_tuning::should_trigger_ngc2())
{
Expand Down Expand Up @@ -31148,7 +31154,7 @@ BOOL gc_heap::plan_loh()

void gc_heap::compact_loh()
{
assert (loh_compaction_requested() || heap_hard_limit || conserve_mem_setting);
assert (loh_compaction_requested() || heap_hard_limit || conserve_mem_setting || (settings.reason == reason_induced_aggressive));

#ifdef FEATURE_EVENT_TRACE
uint64_t start_time = 0, end_time;
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/gc/gcrecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ enum gc_condemn_reason_condition
gen_joined_servo_postpone = 27,
gen_joined_stress_mix = 28,
gen_joined_stress = 29,
gcrc_max = 30
gen_joined_aggressive = 30,
gcrc_max = 31
};

#ifdef DT_LOG
Expand Down

0 comments on commit 6cc44d5

Please sign in to comment.