Omnisharp-vscode: Extension causes high cpu load

Created on 8 Feb 2019  路  16Comments  路  Source: OmniSharp/omnisharp-vscode

  • Issue Type: Performance
  • Extension Name: csharp
  • Extension Version: 1.17.1
  • OS Version: Linux x64 4.18.0-15-generic
  • VSCode version: 1.31.0

ms-vscode.csharp-unresponsive.cpuprofile.txt

Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load

Performance

Most helpful comment

despite setting the logging level to error, I'm still running into the same symptoms. Curiously, I'm running into this on my mac at work. Curiously it looks like mono-sgen64 is eating a ton of CPU. It seems to be triggered by intellisense. If I just type and never hit ctrl+space it seems to be fine.

Screen Shot 2019-04-16 at 1 02 53 PM

All 16 comments

@nbonacchi Can you try upgrading to the latest mono version as suggested here and checking if the problem still persists.
Also, we have a beta release containing major improvements on the code load times. You can install it by following the instructions here. Please let us know if that helps.

I have this same issue with Mono 5.18.

I'm also running into similar performance issues. I've installed mono 5.16 64-bit (no GTK#) from the Visual Studio channel here and ensured it's on my path. Here's the version output:

>mono --version
Mono JIT compiler version 5.16.0 (Visual Studio built mono)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           normal
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        Interpreter:   yes
        LLVM:          supported, not enabled.
        GC:            sgen (concurrent by default)

I've also set "omnisharp.useGlobalMono": true to force it to use that version of mono.

Per @akshita31's recommendation above I've also installed the 1.18.0-beta7 version of the csharp extension via these instructions.

Here's the relevant bits about my setup:

  • Extension Name: csharp
  • Extension Version: 1.18.0-beta7
  • OS Version: Windows_NT x64 10.0.17134
  • VSCode version: 1.31.0 (user setup)

Here's my omnisharp configuration from settings.json:

{
  "omnisharp.autoStart": true,
  "omnisharp.disableMSBuildDiagnosticWarning": false,
  "omnisharp.loggingLevel": "information",
  "omnisharp.maxFindSymbolsItems": 1000,
  "omnisharp.maxProjectResults": 250,
  "omnisharp.minFindSymbolsFilterLength": 0,
  "omnisharp.projectLoadTimeout": 180,
  "omnisharp.useEditorFormattingSettings": true,
  "omnisharp.useGlobalMono": "always",
  "omnisharp.waitForDebugger": false,
}

I've also included a CPU profile: joshampton.CPU-20190211T014534.305Z.cpuprofile.txt

@jrieken I downloaded the profile above that @joshampton uploaded and 96% of the time is consumed by (program). As per https://stackoverflow.com/questions/3847954/what-is-program-in-chrome-debugger-s-profiler this is the program itself. Does that mean it is vscode that is consuming time here ?

Hard to say, generally it should be understood as time is spend outside JS-land, eg inside native land. This can be garbage collection or IPC message overflow. If you zoom in a lot you that some calls are interleaved with something I suspect as omnisharp message handling. Would it be possible that the omnisharp server send a lot of data?

screenshot 2019-02-13 at 08 44 27

@jrieken Yeah omnisharp pushes a lot of messages and that might be the reason for this. I will investigate further into this. Thanks!

Does anyone have any recommendations for a workaround? I've got both Windows and Mac users on my team that are experiencing issues.

@floyd-may I suspect the slow down maybe because omnisharp is sending a lot of messages. Could you try setting "omnisharp.loggingLevel" : error and restart vscode. That way it will only log error messages and might be faster

After a couple hours (I set it to warning because I have issues with following instructions 馃檭 ) it's behaving better. Seems to be a reasonable workaround. I'll report back if I have more issues.

despite setting the logging level to error, I'm still running into the same symptoms. Curiously, I'm running into this on my mac at work. Curiously it looks like mono-sgen64 is eating a ton of CPU. It seems to be triggered by intellisense. If I just type and never hit ctrl+space it seems to be fine.

Screen Shot 2019-04-16 at 1 02 53 PM

despite setting the logging level to error, I'm still running into the same symptoms. Curiously, I'm running into this on my mac at work. Curiously it looks like mono-sgen64 is eating a ton of CPU. It seems to be triggered by intellisense. If I just type and never hit ctrl+space it seems to be fine.

I am having the same.

I get the same with #3336

I got this horribly with recent versions of VS Code inc. 1.40.2 on Ubuntu 18.04

I installed mono globally and set VS Code's extension to always use it.

OmniSharp server started with Mono 6.4.0.
    Path: /home/xyz/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/OmniSharp.exe

@rhyswat did it fix things?

@michaelstaib yes, so far so good. I've only just done it, but VS Code is now useable again.

@rhyswat thanks for your feedback. Will try it out. It is sometimes strange these CPU peaks come and go. I have some files that I cannot open in VSCode, or if I do then the mono exe goes wild. Really annoying. Will try out if that works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hamhub7 picture hamhub7  路  3Comments

jrmcdona picture jrmcdona  路  3Comments

gregg-miskelly picture gregg-miskelly  路  3Comments

kiminuo picture kiminuo  路  3Comments

Alumniminium picture Alumniminium  路  3Comments