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.

C# plugin hangs and cause high CPU usage while opening a big project

See original GitHub issue

Issue Description

Since C# plugin 1.21.13, the C# plugin seems to hang when I open a project with more than 700 files. There is also a side effect that causes extensionHosts to max out a single CPU core. It can be reproduced 100% of the time and I have not experience the hang to finish at any point.

**EDIT: ** My project is a Unity project

1.21.12 was the last version that was working properly for me.

Steps to Reproduce

  1. Open my project with C# plugin 1.21.13 or 1.21.14 installed
  2. Observe OmniSharp log to stop at a point
  3. Observe extensionHosts using nearly 100 unit of CPU image

Expected Behavior

Project loads properly (Omnisharp prints “solution initialized”) in about a minute, Code Lens and jump to declaration works properly.

Actual Behavior

Project does not finish loading, Reference Code Lens does not appear and jump to declaration does not work.

Logs

OmniSharp log

The log contains file names to an already-live project, so I am hesitant to share. In summary, the log stops at the same line of text every time when the issue occurs.

C# log

None

Environment information

VSCode version: 1.43.0 C# Extension: 1.21.13

Mono Information OmniSharp using global mono :6.8.0
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.0.101 Commit: bc5f8df0f5

Runtime Environment: OS Name: Mac OS X OS Version: 10.15 OS Platform: Darwin RID: osx.10.15-x64 Base Path: /usr/local/share/dotnet/sdk/3.0.101/

Host (useful for support): Version: 3.0.1 Commit: 32085cbc72

.NET Core SDKs installed: 2.1.103 [/usr/local/share/dotnet/sdk] 2.1.505 [/usr/local/share/dotnet/sdk] 3.0.101 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.0-rc2-3002702 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.1 [/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.26.3
csharp ms-dotnettools 1.21.13
FlatUI lkytal 1.4.9
theme-bluloco-light uloco 3.0.1
theme-flatui danibram 3.1.0
theme-karyfoundation-themes karyfoundation 20.0.3
vscode-antlr4 mike-lischke 2.2.3
vscode-clang mitaki28 0.2.3
vscode-icons vscode-icons-team 10.0.0
xcode-default-theme smockle 2.0.21

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
NTaylorMullencommented, Mar 18, 2020

@NTaylorMullen I believe this glob is chewing up the CPU for users with large node_modules. https://github.com/OmniSharp/omnisharp-vscode/pull/3593/files#diff-8c9691b11e7b8efdf4865f5653a295c5R175

Oh goodness! Wow that’s awful, i’ll absolutely take a stab at making that code more targeted instead of diving the whole directory.

2reactions
JoeRobichcommented, Mar 18, 2020

@mdowais Thank you so much for your investigation. I was looking through the changes in 1.21.13 and I think you hit on it being the node_modules folder.

@NTaylorMullen I believe this glob is chewing up the CPU for users with large node_modules. https://github.com/OmniSharp/omnisharp-vscode/pull/3593/files#diff-8c9691b11e7b8efdf4865f5653a295c5R175

We’ve had several users share .cpuprofiles which showed a large amount of time in the glob package, but I didn’t give it much weight since I know the heavy lifting is done in .NET.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[RESOLVED as multiple issues] High CPU usage seen in ...
On my quad core laptop, I am seeing constant devenv.exe CPU usage in task manager between 20 and 30%. The only workaround is...
Read more >
Very high CPU usage on indexing and building projects
I have frequent issues with my laptop fans going 100% and other tasks freezing because IntelliJ uses almost 100% of the CPU to...
Read more >
FL freezes upon opening project, 100% CPU load | Forum
Re: FL freezes upon opening project, 100% CPU load​​ EDIT 2: This project will open on my computer when running FL Studio in...
Read more >
Visual Studio Constantly Hangs and Freezes or Restarts Itself ...
The program just completely and instantly closes itself with no warning at all. When the program freezes, in the device manager, Visual Studio ......
Read more >
317249 – [performance] Eclipse frequently hangs with ... - Bugs
Bug 317249 - [performance] Eclipse frequently hangs with high CPU when ... in the project was causing all JavaScript throughout the same project...
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