Skip to content

[release/11.0-preview2]: Fix for OOM exception while running Analyzer tests on x86 platform#14332

Open
Shyam-Gupta wants to merge 1 commit intorelease/11.0-preview2from
dev/shgu/analyzerTests_11.0p2
Open

[release/11.0-preview2]: Fix for OOM exception while running Analyzer tests on x86 platform#14332
Shyam-Gupta wants to merge 1 commit intorelease/11.0-preview2from
dev/shgu/analyzerTests_11.0p2

Conversation

@Shyam-Gupta
Copy link
Member

@Shyam-Gupta Shyam-Gupta commented Feb 26, 2026

Cherry pick from PR:#14328

Issue: Analyzer tests are running into OutOfMemory exceptions on x86 platform. This is because multiple Roslyn compilations are held into memory which causes memory usage to shoot up before GC gets a chance to collect the finalized objects. On x86 the memory space is 2 GB which runs into OOM.

This issue doesn't repro on x64 or when these tests are executed locally in isolation.

Fix: To run GC.Collect after every test execution

Microsoft Reviewers: Open in CodeFlow
Microsoft Reviewers: Open in CodeFlow

…14328)

**Issue**: Analyzer tests are running into OutOfMemory exceptions on x86
platform. This is because multiple Roslyn compilations are held into
memory which causes memory usage to shoot up before GC gets a chance to
collect the finalized objects. On x86 the memory space is 2 GB which
runs into OOM.

This issue doesn't repro on x64 or when these tests are executed locally
in isolation.

**Fix**: To run GC.Collect after every test execution
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/14328)
@Shyam-Gupta Shyam-Gupta added this to the .NET 11 milestone Feb 26, 2026
@Shyam-Gupta Shyam-Gupta self-assigned this Feb 26, 2026
@Shyam-Gupta Shyam-Gupta requested a review from a team as a code owner February 26, 2026 00:22
@Shyam-Gupta Shyam-Gupta added the test-enhancement Improvements of test source code label Feb 26, 2026
@github-actions github-actions bot added the area-Analyzers/CodeFixes A Roslyn Analyzer is either needed for the context, needs to be scope extended or fixed. label Feb 26, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.23713%. Comparing base (6668f68) to head (1964ff7).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           release/11.0-preview2      #14332         +/-   ##
===============================================================
+ Coverage               77.23013%   77.23713%   +0.00699%     
===============================================================
  Files                       3279        3280          +1     
  Lines                     645107      645112          +5     
  Branches                   47731       47731                 
===============================================================
+ Hits                      498217      498266         +49     
+ Misses                    143193      143155         -38     
+ Partials                    3697        3691          -6     
Flag Coverage Δ
Debug 77.23713% <100.00000%> (+0.00699%) ⬆️
integration 19.10119% <ø> (+0.02055%) ⬆️
production 52.17042% <ø> (+0.01529%) ⬆️
test 97.41580% <100.00000%> (+0.00003%) ⬆️
unit 49.52157% <ø> (-0.02572%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Analyzers/CodeFixes A Roslyn Analyzer is either needed for the context, needs to be scope extended or fixed. test-enhancement Improvements of test source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant