-
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
[release/7.0] Low memory fixes #76674
[release/7.0] Low memory fixes #76674
Conversation
Tagging subscribers to this area: @dotnet/gc Issue DetailsWIP
|
e03f616
to
7cfb797
Compare
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.
approved. please elaborate in the customer impact on how this compares with segments/.NET 6. we will take for consideration in 7 ga.
Approved, signed-off, CI green. Ready to merge. |
Customer Impact
This collection of fixes improves the situation when a managed application is run under low memory containers.
Before this change, GCPerfSim (a simple application that continuously allocates memory and keeps a fixed size of them) is unable to survive 70MB under a 600MB container without running into crashes or OutOfMemory.
With these fixes, it is able to survive 280MB (out of the default 450MB hard limit) consistently without crashes or OutOfMemory.
Depending on the types of allocations (i.e. do we (and how much) we allocate on LOH or POH), segments (i.e. .NET 6) were able to survive 300 - 390MB without crashes or OutOfMemory.
This change gets regions closer to 6 (with segments). We could always do better, but that would be a more risky change that we would rather do in .NET 8 instead.
Testing
Beyond testing with GCPerfSim, we ran 48 hours of ReliabilityFramework stress on Windows/x64/Release with both regions and segments and both passed.
None of these changes should have any performance impact, to validate that, I sampled and ran a dozen microbenchmarks and detected no regression.
Risk
Medium, given the change is touching various areas of code.
The change keeps segment intact, so segment is still our safety net. Most changes would be exercised during regular GCs, but they won't make any difference until the process is actually running low on memory.
We ran a lot of tests (reliability and perf) to minimize the risk, and have selected a subset of PRs to be ported to 7.