vscode-csharp
vscode-csharp copied to clipboard
Extension remains in memory even after vscode is closed
Environment data
dotnet: 6.0.202 VS Code version: 1.66.2 C# Extension version: 1.24.4 OS: linux
OmniSharp log
none
Steps to reproduce
I often reload vscode during the day, because it gets slow, or to update extensions, or some other reason.
When I do, the extension is not unloaded from memory, and a new one is loaded. Over time, I have many of them in memory, taking up inotify
instances and memory, eventually leading to me killing them with kill -9
.
So when I do a ps aux | grep dotnettools
I get many like this:
/home/username/.vscode/extensions/ms-dotnettools.csharp-1.24-linux-x64/.razor/rzls -lsp --trace 0
/home/username/.vscode/extensions/ms-dotnettools.csharp-1.24-linux-x64/.razor/rzls -lsp --trace 0
/home/username/.vscode/extensions/ms-dotnettools.csharp-1.24-linux-x64/.razor/rzls -lsp --trace 0
/home/username/.vscode/extensions/ms-dotnettools.csharp-1.24-linux-x64/.razor/rzls -lsp --trace 0
/home/username/.vscode/extensions/ms-dotnettools.csharp-1.24-linux-x64/.razor/rzls -lsp --trace 0
...
This is not a new problem (netcore6 without mono), because it's been happening for a long time (netcore5 with mono, and netcore5 without mono).
Expected behavior
When vscode is closed or reloaded, the extension should be terminated.
Actual behavior
Extension remains in memory, even though vscode is closed.
To reproduce:
- vscode becomes slow
- I restart it using ctrl+shift+p and select
Reload window
option - vscode reloads, the extension is loaded
... but the old instance of the extensions remains in memory, and doesn't release all its inotify
watchers - which makes the system unstable.
So it's a memory and resource leak.
Same here any workaround?
@lonix1 I have been unable to reproduce this issue on MacOS and Ubuntu 20.04. What version of linux are you running?
ubuntu 20.04, vscode 1.67.1, o# 1.24.4 Since I'm not the only one with this problem, it must be something particular to our setup. If anyoe has tips for troubleshooting, please share. Let's try get to the bottom of this.
The same thing has been happening here for some time now, it stays there forever, even after vscode is completely closed.
I'm on macOS 12.4 Monterey, this also happens with my coworker at MacOS 11 Big Sur.
Edit: It happens pretty often. I can reproduce it just by reopening vscode a few times or cmd + shift + p and using Developer: Reload window a few times too.
I'm seeing this also, with the latest version of the C# extension, and the latest Insiders VSCode. Note in the screenshot, there are rzls
processes even for old versions of the C# extension.

Is this issue even being looked at? Seem like a major problem, and no status update since April.
A Month and a half later and nothing.....
This MAJOR problem has been in existence for years. It's something I struggle with multiple times every day.
Related:
- https://github.com/OmniSharp/omnisharp-vscode/issues/5178
- https://github.com/OmniSharp/omnisharp-vscode/issues/2851
- https://github.com/OmniSharp/omnisharp-vscode/issues/5284
- https://github.com/OmniSharp/omnisharp-vscode/issues/3284
- https://github.com/OmniSharp/omnisharp-vscode/issues/3368
- https://github.com/OmniSharp/omnisharp-vscode/issues/4350
Possible diagnoses:
- https://github.com/Azure/bicep/issues/8171#issuecomment-1232322963
- https://github.com/OmniSharp/omnisharp-vscode/issues/4350#issuecomment-1163536551
The vscode team has had trouble reproducing this issue; I hope aggregating these will help them repro and find the root cause.
Hi all! C# extension v1.25.4 was released earlier today which should address this problem. Please let us know if you continue to run into issues. Thanks, and happy coding!
@dibarbet Could you help close out this issue? (I don't have permissions.)