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

Fix high frag in gen2 #48601

Closed
wants to merge 49 commits into from
Closed

Conversation

PeterSolMS
Copy link
Contributor

Details:

  • New config setting GCConserveMemory with values between 0 and 9 - intuitively, the higher the value, the more GC tries to keep gen 2 compact.
  • Implementation: the config value is considered in dt_high_frag_p as the desired percentage/10 of useful data in gen 2. In other words, 100 - config value*10 is the fragmentation threshold above which a blocking gen 2 is performed. For example, if the config setting is 3, we do a blocking gen 2 if the fragmentation in gen 2 is higher than 70%.

Initial perf data suggest this does have the desired effect of trimming down average gen 2 size (and especially trimming it down when the survivorship in gen 2 goes down). There was also the expected effect of larger GC pause times, and an unexpected effect of larger LOH sizes, probably because we also trigger fewer gen 2 collections.

…n when gen 2 fragmentation becomes too high.

Details:
 - New config setting GCConserveMemory with values between 0 and 9 - intuitively, the higher the value, the more GC tries to keep gen 2 compact.
- Implementation: the config value is considered in dt_high_frag_p as the desired percentage*10 of useful data in gen 2. In other words, 100 - config value*10 is the fragmentation threshold above which a blocking gen 2 is performed.
…o make the compaction decision. Also, only do the computations only for gen 1 GCs to cut down on the back-to-back gen 2 GCs that we were observing.
PeterSolMS added a commit to PeterSolMS/runtime-1 that referenced this pull request Aug 3, 2021
@PeterSolMS PeterSolMS closed this Aug 3, 2021
PeterSolMS added a commit that referenced this pull request Aug 31, 2021
Port of ConserveMemory setting we implemented on .NET Framework - we already merged this into .NET Core 5.0.
github-actions bot pushed a commit that referenced this pull request Sep 2, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants