-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[release/9.0-staging] [mono][sgen] Fix incorrect condition when checking if we should do a major collection #120533
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/9.0-staging] [mono][sgen] Fix incorrect condition when checking if we should do a major collection #120533
Conversation
…major collection When we are in this method, major sweep hasn't yet finished so we check with some imprecise conservative values. min_heap_size is a conservative lower limit of the actual heap size. Allowance represents how much more we allow the heap to grow after the previous major collection. We were comparing the min_heap_size with the allowance by mistake, when we should have compared it with the next major trigger size (which is the heap_size after the last collection plus the allowance).
|
Tagging subscribers to this area: @BrzVlad |
|
Reminder that PRs into release/9.0-staging need to be completed by 4pm Redmond time on October 13 to make it into the November servicing release. After that point you'll need to target release/9.0 if you want to make the November release. |
@BrzVlad would this be possible? 😊We would appreciate it alot! |
|
@shnaz Yes, this is on track to be shipped with runtime version 9.0.11, in November. |
Backport of #120432 to release/9.0-staging
/cc @BrzVlad
Customer Impact
This impacts all platforms using mono. A customer reported a 40x regression on an XML Serialization benchmark when moving from .NET8 to .NET9. This regression is caused by the runtime triggering excessive GCs due to a bug in the heuristic. This is more likely to happen if the GC concurrent sweep phase takes longer and the application allocates large objects frequently. This likely impacts many applications, but with less noticeable performance impact.
Regression
This regressed in .NET9
Testing
Tested the fix on sample benchmark that it works correctly.
Risk
Low risk. The fix is localized and the previous condition was blatantly wrong by mistake.