question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension hangs with high CPU usage

See original GitHub issue

Issue 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 mono
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 2.2.101 Commit: 236713b0b7

Runtime 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:open
  • Created 5 years ago
  • Reactions:5
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
akshita31commented, Apr 13, 2019

@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.

0reactions
mic-hnkcommented, Jul 15, 2019

I found a hint in #3079 and removing IDisposable implementations actually helped.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] Chrome High CPU Usage - Driver Easy
Chrome extensions are also known to cause Chrome high system resources usage, such as 100% CPU, memory or disk usage.
Read more >
How to Fix High CPU Usage in Google Chrome
Many Chrome extensions running can lead to issues with high CPU usage, so remove or disable them to lighten the load, advises LinuxHint....
Read more >
How To Fix Google Chrome High CPU usage Windows 10 ...
Google chrome using too much CPU, system freezes while open chrome browser? Here 5 solutions to fix google chrome high CPU usage windows...
Read more >
High CPU usage freezing up and a removed extension that ...
My laptop is freezing processes stop and my CPU is pegged out at over 175% nonstop even with nothing open or running. This...
Read more >
Chrome Extension Hangs up browser (100% CPU) - 3CX
If you have only the 3CX extension installed, open 1 tab in Google, and check task manager - does the CPU usage still...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found