Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Corrected a problem in the computation of the new allocation pointed …
…out in code review.
  • Loading branch information
PeterSolMS committed Jul 14, 2021
commit 13f87e03c33d329591c2bd96b633de95f56ea171
6 changes: 4 additions & 2 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36736,8 +36736,10 @@ static size_t linear_allocation_model (float allocation_fraction, size_t new_all
float decay_factor = (decay_time <= time_since_previous_collection_secs) ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we build a test scenario in GCPerfSim to validate that the decay has the desired effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try, but it may be a bit involved.

0 :
((decay_time - time_since_previous_collection_secs) / decay_time);
dprintf (2, ("allocation fraction: %d", (int)(allocation_fraction/100.0)));
new_allocation = (size_t)(allocation_fraction*new_allocation + (1.0-allocation_fraction)*decay_factor*previous_desired_allocation);
float previous_allocation_factor = (1.0f - allocation_fraction) * decay_factor;
dprintf (2, ("allocation fraction: %d, decay factor: %d, previous allocation factor: %d",
(int)(allocation_fraction*100.0), (int)(decay_factor*100.0), (int)(previous_allocation_factor*100.0)));
new_allocation = (size_t)((1.0 - previous_allocation_factor)*new_allocation + previous_allocation_factor * previous_desired_allocation);
}
return new_allocation;
}
Expand Down