Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Oct 8, 2025

Backport of #120432 to release/10.0

/cc @BrzVlad

Customer Impact

  • Customer reported
  • Found internally

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

  • Yes
  • No

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.

…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).
@BrzVlad BrzVlad added Servicing-consider Issue for next servicing release review area-GC-mono labels Oct 9, 2025
@dotnet-policy-service
Copy link
Contributor

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

@BrzVlad BrzVlad added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 10, 2025
@steveisok
Copy link
Member

This is going in 10.0.1. The milestone hasn't been created yet (I lack the ability to do it).

@steveisok steveisok merged commit c66dbae into release/10.0 Nov 4, 2025
77 of 83 checks passed
@steveisok steveisok deleted the backport/pr-120432-to-release/10.0 branch November 4, 2025 03:55
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-GC-mono Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants