[release/7.0] Fix commit accounting for large pages #78564
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #78531 to release/7.0
/cc @cshung
Customer Impact
The impact of this bug is constrained to users with large pages enabled and this PR fixes the commit accounting so that we don't prematurely OOM. We discovered this issue while investigating a first party customer's out of memory (OOM) issue after upgrading to .NET 7 with regions enabled.
Testing
We were able to reproduce this issue locally and tested that with the fix, the OOM didn't occur. The first party team has additionally confirmed that we are no longer OOM'ing with the patched fix. Additionally, they have been continuing to test this for a couple of days without issue; previously their process would throw an OOM before initialization.
Risk
The risk here is constrained to where large pages are enabled, and the rest of the code path is the same. This is a fix for the aforementioned bug described above and therefore, it should reduce the risk of users getting into an OOM.
IMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.