We have a large solution containing around 95 projects. After I upgraded to the latest version of Rider with the latest version of SonarLint my memory consumption increased to 99%β¦
OmniSharp used 16GB of memory in that case.
After disabling SonarLint the problem did not occure again, but I would like to have SonarLint enabled for obvious reasons.
Thanks for reporting the issue. It is expected that OmniSharp consumes some memory, but 16Gb looks really bad.
We would like to know if this is purely an OmniSharp issue or if this is coming from the addition of our analyzer.
May I ask you to open your solution in VSCode with the VSCode C# extension, open a few files to ensure eveything is loaded, then check how much memory OmniSharp is using?
Do you know if there is a reason for you to have 3 Omnisharp processes? Do you open multiple solutions at the same time?
Do you see the same memory consumption issue when opening your project in VSCode?
Simply open VSCode with the C# plugin installed and open the folder that contains your solution and it should be enough. You can also manually select the .sln you want to load. Wait for language features to appear (intellisense, diagnostics) so ensure OmniSharp is done loading your solution, and then you can check for the memory consumption.
I am getting the same issue. OmniSharp.exe leaks badly when using SonarLint + Rider (2022.1).
I tried profiling on OmniSharp.exe AFTER SonarLint analysis has completed (after seeing the SonarLint analyzing xxx status bar gone and issues report). Basically OmniSharp.exe keeps declaring more memory and never stops.
Here are some results from JetBrains dotMemory snapshots. The snapshots were taken when OmniSharp.exe was using 4GB and 5GB RAM and the analysis had already completed (or as it appeared to be in Rider). (the .csproj I tested only contains 5 .cs and 1 .asmdef files):
I use Rider 2024.1 #RD-241.14494.307, built on April 8, 2024 and have SonarLint 10.4.2.78113. I observe that Rider may have hundreds of .NET and Console window host processes attached which are not there when I disable sonarlint. Also the memory consumption is huge.