Skip to content

VSCode process uses all available memory on remote SSH (memory leak)? #203425

Closed

Description

@dluks

Type: Bug

[Background]
I was recently connected to a remote server via SSH on which VS Code is installed, and the connection failed while I was runinng a process.

I closed the connection and killed the VS code server on remote as well as killing local connections for the server on remote.

I then re-connected to my workspace and noticed that 96/252 GB of the server's memory were being used. I checked the processes and found one VS Code process that was the culprit.

Below I've listed the full process. I can kill the process, but upon re-connecting to the remote the issue begins again.

[Issue]
/home/my-user/.vscode-server-insiders/cli/servers/Insiders-1091f68d834974d78cd4f9769034b4ae4581ff2a/server/node_modules/@vscode/ripgrep/bin/rg --hidden --no-require-git --ignore-case -g **/* -g !**/.git -g !**/.svn -g !**/.hg -g !**/CVS -g !**/.DS_Store -g !**/Thumbs.db -g !**/node_modules -g !**/bower_components -g !**/*.code-search --no-ignore-parent --follow --crlf --engine auto --regexp (?:[\S\s]|\r?\n)+ --no-config --no-ignore-global --json --multiline -- .

VS Code version: Code - Insiders 1.86.0-insider (Universal) (1091f68, 2024-01-24T05:37:21.009Z)
OS version: Darwin x64 21.6.0
Modes:
Remote OS version: Linux x64 5.15.0-91-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz (8 x 2800)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 4, 3, 3
Memory (System) 16.00GB (0.02GB free)
Process Argv --crash-reporter-id c02de7cb-4983-47c3-a989-834afcd4b6b1
Screen Reader no
VM 0%
Item Value
Remote SSH: pylos
OS Linux x64 5.15.0-91-generic
CPUs AMD Ryzen Threadripper PRO 3975WX 32-Cores (64 x 2200)
Memory (System) 251.52GB (154.81GB free)
VM 0%
Extensions (27)
Extension Author (truncated) Version
jupyter-keymap ms- 1.1.2
remote-ssh ms- 0.108.2024012417
remote-ssh-edit ms- 0.86.0
remote-explorer ms- 0.5.2024011009
shebang-snippets rpi 0.1.4
path-intellisense chr 2.8.5
python-environment-manager don 1.2.4
prettier-vscode esb 10.1.0
copilot Git 1.154.672
copilot-chat Git 0.12.2024012401
dvc ite 1.2.6
black-formatter ms- 2023.9.10231018
debugpy ms- 2023.3.13341006
isort ms- 2023.13.10231012
pylint ms- 2023.11.13481007
python ms- 2023.25.10221012
vscode-pylance ms- 2023.12.104
jupyter ms- 2024.1.2024012301
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.17
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
makefile-tools ms- 0.8.22
resourcemonitor mut 1.0.7
vscode-yaml red 1.14.0
even-better-toml tam 0.19.2
vscodeintellicode Vis 1.2.30

(2 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
vsaa593cf:30376535
py29gd2263:30784851
c4g48928:30535728
962ge761:30841072
pythongtdpath:30726887
welcomedialog:30812478
pythonidxpt:30768918
pythonnoceb:30776497
asynctok:30898717
dsvsc013:30777762
dsvsc014:30777825
dsvsc015:30821418
pythontestfixt:30866404
pythonregdiag2:30926734
pyreplss1:30879911
pythonmypyd1:30859725
pythoncet0:30859736
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
b1063948:30943794
fegfb526:30945144
bg6jg535:30946824

Activity

  1. edwardchenchen commented on Jan 25, 2024

    @edwardchenchen

    I am also experiencing this with high CPU usage when updated to the following insider build on remove ssh hosts

    Version: 1.86.0-insider (user setup)
    Commit: 1091f68d834974d78cd4f9769034b4ae4581ff2a
    Date: 2024-01-24T05:36:35.802Z
    Electron: 27.2.3
    ElectronBuildId: 26378995
    Chromium: 118.0.5993.159
    Node.js: 18.17.1
    V8: 11.8.172.18-electron.0
    OS: Windows_NT x64 10.0.22631
    
  2. dluks commented on Jan 25, 2024

    @dluks
    Author

    To update, this does appear to be a memory leak. If left unchecked, all available real and swap memory will be used (currently at 250GB MEM / 220GB SWAP).

  3. changed the title [-]VSCode process using 95 GB of memory on remote SSH (memory leak)?[/-] [+]VSCode process uses all available memory on remote SSH (memory leak)?[/+] on Jan 25, 2024
  4. dluks commented on Jan 25, 2024

    @dluks
    Author

    Another correction: Killing the process manually does not help. The process restarts on its own, making work on the remote impossible. The only way to stop it is to disconnect and Remote: Kill VS Code Server on Host.

  5. roblourens commented on Feb 1, 2024

    @roblourens
    Member

    I think that rg process is coming from Copilot Chat. If you have updated to the latest pre-release version, that should be gone now. You can let me know if it's not gone.

  6. EricBallard commented on Feb 9, 2024

    @EricBallard

    I also was getting this, my development environment was stable for the longest time - and randomly it starts eating RAM like crazy, uses about 1-2gb of ram on an t3a.medium ec2 instance, if I tried to dev on anything less than 2gb of RAM vscode-server would lock the instance.

    I tried many things, deleting /home/user/.vscoder-server
    Stopping the processes manually
    Removing every. single. extension. (It appears Remote SSH actually isn't the issue but it's Remote Explorercausing the memory leak)
    Trying different versions of, remote ssh, remote explorer, and vscode

    Well finally I had enough - the fix for me to use Code-Server instead - runs more stable, uses less resources, and it's very responsive.

    https://github.com/coder/code-server

  7. DimIsaev commented on May 6, 2024

    @DimIsaev

    same problems

  8. locked and limited conversation to collaborators on Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions