microsoft / vscode

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

BIG BUG needs Squashing ! VSCode is running dozens of background processes when only 2-3 files are open. #138481

Closed richlysakowski closed 2 years ago

richlysakowski commented 2 years ago

This problem of too many background processes has been plaguing me since the first time I started using VSCode in 2019. It never closes processes when I close files, always spawning new processes.

I am surprised nothing has really been done to fix since 2019, just more MS-GoRound (disable Microsoft Extensions, try this, try that, disable blah, blah, blah).

Why isn't there a garbage collector for VSCode background processes ???

At this point I usually go back to using Jupyter Notebook or Spyder., because they are more process and memory efficient, with fewer bugs and performance problems to report.

Is there a fix for this? Or is there a Best Practices document for usage to make me as a user more process aware?

I am using a recent update of VSCode:

code --status


Version:          Code 1.62.3 (ccbaa2d27e38e5afa3e5c21c1c7bef4657064247, 2021-11-17T08:11:14.551Z)
OS Version:       Windows_NT x64 10.0.19043
CPUs:             Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208)
Memory (System):  63.76GB (39.88GB free)
VM:               0%
Screen Reader:    no
Process Argv:     C:\Users\richadmin\OneDrive\00-2021-Student-Area\07-Jupyter-All-About-It\50-Jupyter-Tools-Hacking-4-cleaning-and-filing\InteractiveWidgets\Account_Info_Input_Form-RSL-WIP.ipynb --crash-reporter-id 444025d4-7455-48c3-ad89-37e92438f893
GPU Status:       2d_canvas:                  enabled
gpu_compositing:            enabled
multiple_raster_threads:    enabled_on
oop_rasterization:          enabled
opengl:                     enabled_on
rasterization:              enabled
skia_renderer:              enabled_on
video_decode:               enabled
vulkan:                     disabled_off
webgl:                      enabled
webgl2:                     enabled

CPU % Mem MB PID Process 0 114 43688 code main 0 35 24360 utility 0 23 29688 crashpad-handler 0 217 34180 window (tda_api_test.py - PyTDA-workspace (Workspace) - Visual Studio Code) 0 133 18544 extensionHost 0 58 6536 c:\Users\richadmin\Desktop\tos_apps\tosapps\Scripts\python.exe c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\run-jedi-language-server.py 0 5 17396 console-window-host (Windows internal process) 0 15 39976 c:\Users\richadmin\Desktop\tos_apps\tosapps\Scripts\python.exe c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\jedilsp\jedi\inference\compiled\subprocess__main.py c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\jedilsp 3.7.10 0 5 36848 console-window-host (Windows internal process) 0 51 11232 C:\ProgramData\Anaconda3\envs\consuming_http\python.exe c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\run-jedi-language-server.py 0 18 36928 C:\ProgramData\Anaconda3\envs\consuming_http\python.exe c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\jedilsp\jedi\inference\compiled\subprocess\main.py c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\jedilsp 3.9.7 0 5 36836 console-window-host (Windows internal process) 0 5 41640 console-window-host (Windows internal process) 0 69 14328 "C:\Program Files\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\richadmin.vscode\extensions\mtxr.sqltools-0.23.0\dist\languageserver.js --node-ipc --clientProcessId=18544 0 79 16260 "C:\Program Files\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\richadmin.vscode\extensions\znck.grammarly-0.14.0\dist\server\index.js --node-ipc --clientProcessId=18544 0 14 19560 C:\ProgramData\Anaconda3\envs\consuming_http\python.exe c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\run-jedi-language-server.py 0 7 19444 C:\ProgramData\Anaconda3\envs\consuming_http\python.exe c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\jedilsp\jedi\inference\compiled\subprocess\main.py c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\jedilsp 3.9.7 0 5 39348 console-window-host (Windows internal process) 0 5 41440 console-window-host (Windows internal process) 0 61 19756 C:\ProgramData\Julia-1.3.1\bin\julia.exe --startup-file=no --history-file=no --depwarn=no --project=c:\Users\richadmin.vscode\extensions\julialang.language-julia-1.5.6\scripts\environments\languageserver main.jl C:\Users\richadmin.julia\environments\v1.3 --debug=no \.\pipe\vsc-jl-cr-40a027d9-b036-47bf-a9a5-4160c1d837e7 "" c:\Users\richadmin\AppData\Roaming\Code\User\globalStorage\julialang.language-julia download https://www.julia-vscode.org/symbolcache --detached=no 0 5 27844 console-window-host (Windows internal process) 0 70 21528 "C:\Program Files\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node c:\Users\richadmin.vscode\extensions\ckolkman.vscode-postgres-1.1.19\out\language\server.js --node-ipc --clientProcessId=18544 0 6 24124 C:\ProgramData\Anaconda3\envs\PyQt5Options\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v 0 5 40432 console-window-host (Windows internal process) 0 61 25920 electron_node hu.js 0 6 10612 console-window-host (Windows internal process) 0 6 27436 C:\ProgramData\Anaconda3\envs\PyQt5Options\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v 0 5 27900 console-window-host (Windows internal process) 0 6 41632 C:\ProgramData\Anaconda3\envs\PyQt5Options\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v 0 5 36052 console-window-host (Windows internal process) 0 14 43436 c:\ProgramData\Anaconda3\envs\pyTDA_pipOK\python.exe c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\run-jedi-language-server.py 0 8 3832 c:\ProgramData\Anaconda3\envs\pyTDA_pipOK\python.exe c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\jedilsp\jedi\inference\compiled\subprocess\main__.py c:\Users\richadmin.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\lib\jedilsp 3.8.12 0 5 38180 console-window-host (Windows internal process) 0 5 21580 console-window-host (Windows internal process) 0 73 24860 watcherServiceParcel 0 166 35264 gpu-process 0 84 35884 window (undefined) 0 7 39524 "C:\Program Files\Google\Drive File Stream\53.0.8.0\crashpad_handler.exe" --database=C:\Users\richadmin\AppData\Local\Google\DriveFS\Crashpad --url=https://clients2.google.com/cr/report --annotation=application=Code.exe --annotation=prod=DriveFS --annotation=ver=53.0.8.0 --initial-client-data=0x107c,0x11a4,0x1190,0x11a0,0x11c4,0x7ffd27301930,0x7ffd27301940,0x7ffd27301950 0 79 39844 shared-process 0 78 5356 ptyHost 0 6 18232 console-window-host (Windows internal process) 0 4 21760 C:\WINDOWS\System32\cmd.exe

Workspace Stats: | Window (tda_api_test.py - PyTDA-workspace (Workspace) - Visual Studio Code) | Folder (00 - pyBlackScholesAnalytics): 235 files | File types: py(82) png(29) PNG(27) ipynb(24) pyc(13) md(8) pdf(7) | gitignore(2) json(2) yml(2) | Conf files: | Folder (! 00 - 2021-November): 355 files | File types: ipynb(81) py(68) zip(19) rst(18) png(11) ini(9) pyc(9) | txt(8) pdf(8) json(7) | Conf files: makefile(3) launch.json(1) settings.json(1) | Launch Configs: python



<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version:
- OS Version:

Steps to Reproduce:

1.
2.
rebornix commented 2 years ago

Starting from @DonJayamanne to help provide insights since most processes are data science related

DonJayamanne commented 2 years ago

Sorry, didn't realize there were other extensions at play here that spawn other processes. I'll created a separate issue in Jupyter repo to tackle the processes spawned by that extension.

PyQt5Options\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v

These are the only two spawned by Jupyter extension, again will create an issue and provided instruction on disabling this there (we have an option to turn this off).

DonJayamanne commented 2 years ago

@richlysakowski

I'm sorry you're experiencing this issue. The Jupyter extension is responsible for spawning the processes python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v You can turn this off by adding the following setting "jupyter.disableJupyterAutoStart": true into your user settings.

These are spawned to improve performance of notebooks in the Jupyter extension. However, as mentioned earlier, you can turn this off (when a Python file is opened).

Note: Even if after setting this, and shutting down VS Code those same python ... daemon processes still hang around, please could you file an issue here (https://github.com/microsoft/vscode-jupyter) and we'll be able to look into this.

DonJayamanne commented 2 years ago

At this point I usually go back to using Jupyter Notebook or Spyder., because they are more process and memory efficient, with fewer bugs and performance problems to report.

There are three other extensions that spawn other processes as well. It is my understanding these are spawned as you have extensions that provide functionality when a Python file or Notebook is opened. E.g. the Julia extension provides functionality for Notebooks, and I believe SQL, Postgress, grammarly too provide functionality for notebooks and Python files as well.

If you were to shutdown VS Code, do these processes not die? If not please could you file an issue with them. FYI - I've created an issue in Python Github repo. For the other please could you file it, as i'm not sure whether its a bug or by design, if its by design, then as mentioned some of theose extensions might have a valid reason and could be providing some useful features for Python/ipynb notebooks.

DonJayamanne commented 2 years ago

Again, I'm sorry you've been running into this since 2019, unfortunately I've been unable to locate any issues filed by you before this. I'll discuss this with the team and get back with more information/suggestions or what we can do in this space.

DonJayamanne commented 2 years ago

I've since found that some extensions were activating unnecssarily @richlysakowski For now these extensions seem to be unnecessarily getting activated. I have file issues in the repos, however there's not much we can do in VS Code, as VS Code doesn't control what each extension does.

So, I think the only issue is with the Python extension and the Jupyter extension at this stage. please could you confirm there are no other issues. This way, we can tackle this issue in the corresponding repos (e.g. Python, Jupyter, Postgres, SQLTools, Grammarly).

@rebornix Do you have any other thoughts on this?

DonJayamanne commented 2 years ago

@richlysakowski Response for python extension is as follows, looks like it is by design vscode-python#18120

We don't see anything here that is out of the ordinary.

Right now the only issue is with the Jupyter extension, and I have provided a solution and if that still doesn't work please file an issue in the Jupyter repo.

Closing this as there's no need to have an issue with all extensions mentioned as there's a response/solution for all them