Skip to content
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

Merged
merged 3 commits into from
Oct 7, 2022

Conversation

cshung
Copy link
Member

@cshung cshung commented Oct 5, 2022

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.

@cshung cshung self-assigned this Oct 5, 2022
@ghost
Copy link

ghost commented Oct 5, 2022

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Issue Details

WIP

Author: cshung
Assignees: cshung
Labels:

area-GC-coreclr

Milestone: -

@carlossanlop carlossanlop marked this pull request as draft October 5, 2022 18:07
src/coreclr/gc/gc.cpp Outdated Show resolved Hide resolved
@cshung cshung marked this pull request as ready for review October 6, 2022 05:56
@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Oct 6, 2022
@jeffschwMSFT jeffschwMSFT added this to the 7.0.0 milestone Oct 6, 2022
@jeffschwMSFT jeffschwMSFT removed the Servicing-consider Issue for next servicing release review label Oct 6, 2022
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a 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.

@jeffschwMSFT jeffschwMSFT added the Servicing-approved Approved for servicing release label Oct 6, 2022
@carlossanlop
Copy link
Member

Approved, signed-off, CI green. Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit e9ff65a into dotnet:release/7.0 Oct 7, 2022
@cshung cshung deleted the public/low-memory-fix-7 branch October 7, 2022 00:43
@ghost ghost locked as resolved and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-GC-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants