microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.67k stars 28.68k forks source link

Visual studio code remote SSH is taking too much of RAM #175830

Closed dokutoshi closed 1 year ago

dokutoshi commented 1 year ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce: Launch a Remote SSH session using a Jupyter notebook extension on a long ML training on compute intensive project. While there are times the memory will stabilize, there are a few times the memory runs away leading to a OOM crash.

This ticket was closed too early: https://github.com/microsoft/vscode/issues/151205 I also have a similar issue where Remote SSH for a ML training set has VSCode using about 4-10GB on a Macbook M1.

Apparently this is enough of an issue, that someone wrote an article about the issue.

https://medium.com/good-robot/use-visual-studio-code-remote-ssh-sftp-without-crashing-your-server-a1dc2ef0936d

Why is VSCode installing node server on remote machines? This is problematic on server environments.

dokutoshi commented 1 year ago

As a follow-up, I believe the issue is upon terminating VSCode is that the node server process on an EC2, as an example, does not terminate. I can share a week's technical support conversation with AWS if it is helpful. Node server spawning other node processes killed a few servers that contained only 16GB.

roblourens commented 1 year ago

Why is VSCode installing node server on remote machines? This is problematic on server environments.

This is how vscode remote works. See our remote docs for a descriptions.

I need more details to be able to do anything about this. Which processes exactly are using too much RAM? What are their full command line arguments? What extensions are on the remote? etc

dokutoshi commented 1 year ago

@roblourens allow me to answer.

Here is a snapshot where multiple node servers appear, started by the Remote SSH application. Image 3-2-23 at 10 59 PM

Key question, why is the node server consuming more the application memory? Currently, the results are benign from an absolute value without print statements (enumerations). Once there are print enumerations, etc, the node server memory increases drastically.

Extensions

Per the medium article, disabling the NodeJS/TS default extension removes the node server and the memory hog.

roblourens commented 1 year ago

Currently, the results are benign from an absolute value without print statements (enumerations). Once there are print enumerations, etc, the node server memory increases drastically.

I don't really understand this sentence, can you explain?

Per the medium article, disabling the NodeJS/TS default extension removes the node server and the memory hog.

Do you mean the typescript language extension? There is no NodeJS extension

dokutoshi commented 1 year ago

Currently, the results are benign from an absolute value without print statements (enumerations). Once there are print enumerations, etc, the node server memory increases drastically.

I don't really understand this sentence, can you explain?

Per the medium article, disabling the NodeJS/TS default extension removes the node server and the memory hog.

Do you mean the typescript language extension? There is no NodeJS extension

I few notes to clarify.

  1. Inner loop print statements aka enumerations e.g. counter for a loop to convert images for a ML model. Despite a remote process, the local VSCode instance executes inefficiently. As a recommendation, use the MNIST dataset with remote SSH and observe the RAM utilization.

  2. Correct, the TS language extension creates a node service on the remote (target) server. As depicted in the screenshot, the remote node service utilizes 10%+ of available RAM. In fact, the node service scales with the application's RAM utilization. I agree with this author's post: Remote SSH Crashes local VSCode

roblourens commented 1 year ago

Inner loop print statements aka enumerations e.g. counter for a loop to convert images for a ML model. Despite a remote process, the local VSCode instance executes inefficiently. As a recommendation, use the MNIST dataset with remote SSH and observe the RAM utilization.

This isn't a helpful recommendation for me, I would need something much more specific.

As depicted in the screenshot, the remote node service utilizes 10%+ of available RAM

The screenshot is showing some node process using lots of RAM, it doesn't tell me which one it is.

Sorry, I get that there is a frustrating issue, but I don't think that this issue report adds anything beyond other issue reports or the blog posts that you have linked. I'm going to close it unless there are specific details that can help me figure out what needs to change in vscode.

cenedella commented 1 year ago

@roblourens is this being worked on in another ticket? this signature - '/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false' keeps showing up for me as the culprit.