Extension hangs with high CPU usage
See original GitHub issueIssue Description
When loading some projects, the C# extension hangs, and the “mono” process is stuck running at at 100%+ CPU utilization. No language services that involve the language server (IntelliSense, hover, etc.) work.
Steps to Reproduce
On a Mac, clone the Microsoft Python Language Server project (https://github.com/Microsoft/python-language-server) Launch VSCode and open the primary workspace for the cloned repo Install the C# extension if it’s not already installed
Open the “Activity Monitor” and sort the processes by CPU. Note that the “mono” process is now running at 100%+ In VSCode, open the output view and switch to the “OmniSharp Log”. Note that the last line says: Loading project: /python-language-server/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj
I allowed it to run for 15 minutes before terminating it.
I presume this is an issue with OmniSharp, as opposed to the javascript portion of the language server.
I tried rebuilding previous versions of the C# extension (1.16.2, 1.15.2) to see if this was a recent regression, but I was able to repro the same problem with those versions.
I tried the same scenario on Windows, and it worked fine. The OmniSharp log contained additional contents including the line Successfully loaded project file
. On the Mac, this was never emitted to the log.
OmniSharp log
Starting OmniSharp server at 12/24/2018, 11:38:57 PM
Target: /Users/eric/source/python-language-server/src/PLS.sln
OmniSharp server started.
Path: /Users/eric/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/run
PID: 10020
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on MacOS 10.13.6 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 15.0 - "/Users/eric/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/eric/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 15.0 - "/Users/eric/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin"
MSBuildExtensionsPath = /Users/eric/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild
BypassFrameworkInstallChecks = true
CscToolPath = /Users/eric/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin/Roslyn
CscToolExe = csc.exe
MSBuildToolsPath = /Users/eric/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/msbuild/15.0/Bin
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/eric/source/python-language-server/src'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.WorkspaceInitializer
Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/Users/eric/source/python-language-server/src/PLS.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/eric/source/python-language-server/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/eric/source/python-language-server/src/UnitTests/Core/Impl/UnitTests.Core.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/eric/source/python-language-server/src/Analysis/Engine/Impl/Microsoft.Python.Analysis.Engine.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/eric/source/python-language-server/src/Analysis/Engine/Test/Microsoft.Python.Analysis.Engine.Tests.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/eric/source/python-language-server/src'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/Users/eric/source/python-language-server/src' on host 10001.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/eric/source/python-language-server/src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj
C# log
<No output>
Environment information
VSCode version: 1.30.1 C# Extension: 1.17.1
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 2.2.101 Commit: 236713b0b7Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path: /usr/local/share/dotnet/sdk/2.2.101/
Host (useful for support): Version: 2.2.0 Commit: 1249f08fed
.NET Core SDKs installed: 2.2.101 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
cpptools | ms-vscode | 0.20.1 |
csharp | ms-vscode | 1.17.1 |
python | ms-python | 2018.12.1 |
tslint | eg2 | 1.0.42 |
vscode-docker | PeterJausovec | 0.4.0 |
vscode-proto3 | zxh404 | 0.2.2 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:5 (1 by maintainers)
Top GitHub Comments
@erictraut @Jma353 Could you try with the latest release of the C# extension? We have made some performance improvements that should make the experience better.
I found a hint in #3079 and removing IDisposable implementations actually helped.