Open Lobosque opened 3 years ago
I think I'm affected by the same problem, originally reported at https://github.com/microsoft/vscode/issues/114224
Issue Type: Bug
I have a project that references several GB of source files, spread out over hundreds of thousands of files. VSCode opens the project nicely and makes it possible to work with and search through the files.
However every once in a while it crashes my computer. I've seen that a process called "rzls" seems to hog immense amounts of RAM, in the range of 80-90% of all available RAM. Today it crashed my work computer with 64GM of RAM (No compile was running at the time of the crash, and not many other applications where open).
See attached screenshot for an example of the extreme memory usage on a powerful laptop).
VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:32:10.090Z) OS version: Linux x64 5.4.0-60-generic
rzls is the Razor Language Server. @ryanbrandenburg @NTaylorMullen could you have a look?
Also happens to me. Especially when I try to start typing before OmniSharp has completely started up (which now takes ages for my Unity project). If you type in this situation, OmniSharp goes completely nuts, it displays tons of error messages at random positions, like shown above.
For an immediate workaround you can set the
{
"razor.disabled": true
}
Setting to turn off the Razor experience and free yourself of the Razor magic 😄.
For next steps in investigating this would you mind moving this issue over to https://github.com/dotnet/aspnetcore?
Also, if you could provide some additional information to help us investigate that'd be super helpful.
dotnet-trace
on the rzls process to capture some info for usI am a bit confused. What is Razor, and where can I set this option?!
I am a bit confused. What is Razor Razor is a markup syntax for embedding server-based code into webpages. The Razor syntax consists of Razor markup, C#, and HTML. Files containing Razor generally have a .cshtml file extension. Razor is also found in Razor components files (.razor).
where can I set this option?!
It's a VSCode option. Docs on how to change VSCode options: https://code.visualstudio.com/docs/getstarted/settings
I'm seing similar problems. Codelens having trouble displaying correctly if I navigate through files.
From the OmniSharp Log
Received response for /v2/codestructure but could not find request.
Even after quitting VSCode, around ~120 rzls
process are still running
@NTaylorMullen Have you seen this behavior with rzls berfore?
@NTaylorMullen Have you seen this behavior with rzls berfore?
Maybe agess and ages ago. Nothing in the past year or so though
FWIW i don't have GB projects and i don't have crashes, BUT i do experience leftover rzls processes after closing VS Code.
Maybe related, looks like the VS Code extension is leaving behind stale rzls processes? Only noticed it today after looking at what is occupying so much compressed memory. I was able to replicate what is in the picture below by just repeatedly opening and closing a Blazor project in VS Code.
Looks a lot more like what @dchennaraidu is posting, should we open another separate issue? The original issue here is a single rzls process using excessive memory, our problem lies in stale rzls processes?
The last two are the only currently opened instances.
I was able to replicate what is in the picture below by just repeatedly opening and closing a Blazor project in VS Code.
@PheelaV Can you describe the steps used to open and close the Blazor project? We've had a hard time reproducing this behavior. Some have reported they can reproduce this by invoking the "Reload Window" command, but I cannot.
@JoeRobich Yes, that also triggers it. Here are the rest of the details. Please let me know if there is any more info I can get you.
``` .NET SDK (reflecting any global.json): Version: 6.0.301 Commit: 43f9b18481 Runtime Environment: OS Name: Mac OS X OS Version: 12.4 OS Platform: Darwin RID: osx.12-arm64 Base Path: /usr/local/share/dotnet/sdk/6.0.301/ Host (useful for support): Version: 6.0.6 Commit: 7cca709db2 .NET SDKs installed: 6.0.301 [/usr/local/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] ```
VS Code version:
C# Extension version:
``` Starting OmniSharp server at 22/06/2022, 18:43:30 Target: /Users/user/Source/scratch_code/BlazorApp1/BlazorApp1.sln OmniSharp server started with .NET 6.0.301 . Path: /Users/user/.vscode/extensions/ms-dotnettools.csharp-1.25.0-darwin-arm64/.omnisharp/1.39.0-net6.0/OmniSharp.dll PID: 42528 [info]: OmniSharp.Stdio.Host Starting OmniSharp on Unknown 0.0 (Unknown) [info]: OmniSharp.Services.DotNetCliService Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK [info]: OmniSharp.Services.DotNetCliService Using the 'dotnet' on the PATH. [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 1 MSBuild instance(s) 1: .NET Core SDK 6.0.301 17.2.0 - "/usr/local/share/dotnet/sdk/6.0.301/" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: .NET Core SDK 6.0.301 17.2.0 - "/usr/local/share/dotnet/sdk/6.0.301/" [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 [info]: OmniSharp.MSBuild.ProjectSystem Detecting projects in '/Users/user/Source/scratch_code/BlazorApp1/BlazorApp1.sln'. [info]: OmniSharp.MSBuild.ProjectManager Queue project update for '/Users/user/Source/scratch_code/BlazorApp1/BlazorApp1/BlazorApp1.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in '/Users/user/Source/scratch_code/BlazorApp1'. [info]: OmniSharp.Script.ScriptProjectSystem Did not find any CSX files [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location '/Users/user/Source/scratch_code/BlazorApp1' on host 42491. [info]: OmniSharp.MSBuild.ProjectManager Loading project: /Users/user/Source/scratch_code/BlazorApp1/BlazorApp1/BlazorApp1.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file '/Users/user/Source/scratch_code/BlazorApp1/BlazorApp1/BlazorApp1.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project '/Users/user/Source/scratch_code/BlazorApp1/BlazorApp1/BlazorApp1.csproj' [info]: OmniSharp.MSBuild.ProjectManager Update project: BlazorApp1 ```
code .
After quitting VS Code, it's accompanying processes should be cleaned up.
rzls processes pile up
Developer: Reload Window
is also sufficient to trigger the repro.
@PheelaV Thanks for your feedback. I can finally reproduce this issue. Closing VS Code after rzls starts but before the C# extension is fully activated causes rzls to be orphaned. If the C# extension is allowed to activate, then rzls is killed when VS Code closes. FYI: @NTaylorMullen, @ryanbrandenburg
Closing VS Code after rzls starts but before the C# extension is fully activated causes rzls to be orphaned. If the C# extension is allowed to activate, then rzls is killed when VS Code closes.
@JoeRobich I have left the VS Code instance to do its thing for at least a minute (the Blazor project I am using for this is just a dotnet new blazorserver --name BlazorApp
)
I get the "project requires assets to build" or whatever it states exactly. Behaviour stays the same even after I confirmed or cancelled the dialogue (in case it somehow prevented omnisharp from folly activating)
Also
``` 2gua.rainbow-brackets adpyke.vscode-sql-formatter aeschli.vscode-css-formatter ban.spellright bierner.markdown-preview-github-styles christian-kohler.path-intellisense codelios.dartsass codezombiech.gitignore dariofuzinato.vue-peek dbaeumer.vscode-eslint dendron.dendron dendron.dendron-markdown-shortcuts dendron.dendron-paste-image donjayamanne.githistory eamodio.gitlens ecmel.vscode-html-css EditorConfig.EditorConfig fabianlauer.vs-code-xml-format formulahendry.dotnet-test-explorer GitLab.gitlab-workflow glenn2223.live-sass golang.go Gruntfuggly.todo-tree HarryHopkinson.vs-code-runner mechatroner.rainbow-csv mitchdenny.ecdc mohsen1.prettify-json moshfeu.compare-folders ms-azuretools.vscode-azureappservice ms-azuretools.vscode-azureresourcegroups ms-azuretools.vscode-docker ms-dotnettools.csharp ms-python.python ms-python.vscode-pylance ms-toolsai.jupyter ms-toolsai.jupyter-keymap ms-toolsai.jupyter-renderers ms-vscode-remote.remote-containers ms-vscode-remote.remote-ssh ms-vscode-remote.remote-ssh-edit ms-vscode-remote.remote-wsl ms-vscode.azure-account ms-vscode.hexeditor ms-vscode.powershell ms-vsliveshare.vsliveshare mtxr.sqltools octref.vetur PKief.material-icon-theme redhat.vscode-yaml REditorSupport.r ritwickdey.LiveServer rogalmic.bash-debug slevesque.vscode-autohotkey stucci.line-filter Tobermory.es6-string-html Tyriar.luna-paint Vue.volar Zignd.html-css-class-completion ```
This MAJOR problem has been in existence for years. It's something I struggle with multiple times every day.
Related:
Possible diagnoses:
The vscode team has had trouble reproducing this issue; I hope aggregating these will help them repro and find the root cause.
@NTaylorMullen, @ryanbrandenburg Is there an update on this? I find that just leaving VS Code open on some of our internal projects causes rzls.exe to slowly gobble gigs of memory even when I have no files open. It also causes the horrible anti-virus the company uses to inspect thousands of files that it shouldn't need to.
Looks like razor.disabled
was removed as well. Is there some way to disable it?
Issue Description
As our project grows it is becoming more and more common to have Omnisharp crashing randomly or just taking too long to process files (even the currently open file). Take a look at this example where the hinting makes no sense at all:
Steps to Reproduce
Expected Behavior
Actual Behavior
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.52.1 C# Extension: 1.23.8
Mono Information
OmniSharp using built-in monoDotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.100-rc.2.20479.15 Commit: da7dfa8840 Runtime Environment: OS Name: debian OS Version: 10 OS Platform: Linux RID: debian.10-x64 Base Path: /usr/share/dotnet/sdk/5.0.100-rc.2.20479.15/ Host (useful for support): Version: 5.0.0-rc.2.20475.5 Commit: c5a3f49c88 .NET SDKs installed: 5.0.100-rc.2.20479.15 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.0-rc.2.20475.17 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.0-rc.2.20475.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |csharp|ms-dotnettools|1.23.8| |dotnet-test-explorer|formulahendry|0.7.4| |gitlab-workflow|GitLab|3.9.0| |gitlens|eamodio|11.1.3| |vsliveshare|ms-vsliveshare|1.0.3484|;