vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Extension remains in memory even after vscode is closed

Open lonix1 opened this issue 2 years ago • 9 comments

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.

lonix1 avatar Apr 20 '22 00:04 lonix1

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.

lonix1 avatar Apr 25 '22 15:04 lonix1

Same here any workaround?

fortiasoft avatar May 13 '22 08:05 fortiasoft

@lonix1 I have been unable to reproduce this issue on MacOS and Ubuntu 20.04. What version of linux are you running?

JoeRobich avatar May 20 '22 21:05 JoeRobich

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.

lonix1 avatar May 20 '22 22:05 lonix1

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

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.

AAulicino avatar Jun 11 '22 06:06 AAulicino

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.

image

jtsom avatar Jun 15 '22 00:06 jtsom

Is this issue even being looked at? Seem like a major problem, and no status update since April.

jtsom avatar Jul 01 '22 19:07 jtsom

A Month and a half later and nothing.....

jtsom avatar Aug 24 '22 20:08 jtsom

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.

lonix1 avatar Sep 08 '22 10:09 lonix1

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

allisonchou avatar Jan 25 '23 00:01 allisonchou