Fix for OOM exception while running Analyzer tests on x86 platform - #14328
Conversation
…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 iteration.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14328 +/- ##
===================================================
- Coverage 77.23556% 77.23481% -0.00076%
===================================================
Files 3279 3280 +1
Lines 645107 645112 +5
Branches 47731 47731
===================================================
- Hits 498252 498251 -1
- Misses 143161 143164 +3
- Partials 3694 3697 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Look good now. Yay to VB's pretty lister! 😺
And unbelievable quick turn-around - I am getting concerned here! 😉
No, honestly - Copilot or not Copilot: The thing is, one has to have the creativity and the knowledge to ask the right questions and point in the assumed directions. Scary fast turn-around, for that niche a bug. @merriemcgaw, @mcastro-x FYI just because for deserved visibility.
Keep in mind everyone, we are about to throw another 15 - 20 Analyzers in here, which are ready, and are working. But in a Linux docker, under Linux. Totally different platform. Probably never would have crashed or throw OOM. Had I been running into that in that context...I can only hope that my pattern matching would have helped me, so, this is really remarkable and has probably saved us days at least.
|
Thanks Klaus. These changes will certainly help us stabilize the test issues in CI pipeline. |
…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)
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