-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradual decommit in wks #73620
Gradual decommit in wks #73620
Conversation
This is the regions version modeled after the behavior of the segments version. Idea is simply to limit the amount of decommitted memory based on the time since the last GC.
…es the logic for the WKS decommit more straightforward.
Tagging subscribers to this area: @dotnet/gc Issue DetailsThis addresses a performance regression with regions which was caused by decommitting memory more agressively than with segments. The fix is to essentially replicate the logic used with segments - we use the time elapsed since the last GC to compute the size we should decommit in this GC. The goal is to ramp down gradually rather than suddenly, in case the application uses more memory again in the future.
|
src/coreclr/gc/gc.cpp
Outdated
@@ -12845,8 +12847,23 @@ void gc_heap::distribute_free_regions() | |||
} | |||
} | |||
#else //MULTIPLE_HEAPS | |||
while (decommit_step()) | |||
// we want to limit the amount of decommit we do per time to indirectly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is similar logic already implemented for the svr case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in SVR case gc thread #0 wakes up every 100 ms and call decommit_step().
it would be good to take this opportunity to consolidate the decommit we do for regions for WKS. right now we do call |
The logic concerning regions in I have looked into consolidating the logic in So my vote would be to keep this as is. |
@PeterSolMS I meant this actual decommit for WKS GC in
not what you added at the top of this method that sets the decommit target for regions in SVR GC (that doesn't actually do any decommit). the |
…_segment_pages for WKS, some changes in distribute_free_regions as a consequence.
/azp run runtime |
Azure Pipelines successfully started running 1 pipeline(s). |
The OSX timeouts are unrelated infra issue per Build Analysis. Merging since this needs to be ported to 7 |
/backport to release/7.0 |
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3144439093 |
This addresses a performance regression with regions which was caused by decommitting memory more agressively than with segments.
The fix is to essentially replicate the logic used with segments - we use the time elapsed since the last GC to compute the size we should decommit in this GC. The goal is to ramp down gradually rather than suddenly, in case the application uses more memory again in the future.