question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode leaves several running processes after exit

See original GitHub issue

Issue Type: Bug

Steps to reproduce:

  1. Launch vscode.
  2. Open or create a Jupyter Notebook.
  3. Do some work on it.
  4. Close vscode.
  5. Optional: Rinse and repeat.

Expected behavior:

Any processes started by vscode are closed.

Actual behavior:

After launching and closing vscode a few times (and realizing I am starting to run out of memory) I notice this:

user@laptop:~$ ps aux | grep -v networkd-dispatcher | grep -v unattended | grep -v grep | grep python
user   344513  0.2  0.6 4115828 102040 ?      Sl   May19   3:19 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   345452  0.4  5.3 5162548 858400 ?      Sl   May19   5:46 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   345607  0.2  0.6 4443632 102484 ?      Sl   May19   3:01 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   353204  0.2  0.6 3788220 105468 ?      Sl   May19   1:55 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   353605  0.0  0.2 117072 46508 ?        S    May19   0:01 /usr/bin/python3 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
user   353771  0.3  0.6 3796468 105576 ?      Sl   May19   2:29 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   353933  0.2  0.2 3722708 39000 ?       Sl   May19   1:31 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   354840  0.2  0.2 3796424 35728 ?       Sl   00:35   1:34 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   355331  0.9  5.4 6179224 869260 ?      Sl   00:39   6:06 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   356104  0.3  0.6 3862044 111216 ?      Sl   00:52   1:52 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   366116  1.6  0.4 3796252 76032 ?       Sl   10:27   0:35 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   366803  2.3  0.4 1007044 69596 ?       Sl   10:32   0:44 /usr/bin/python3 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
user   366808 10.1  5.4 5509256 871684 ?      Sl   10:32   3:16 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/languageServer.0.5.50/Microsoft.Python.LanguageServer
user   366831  0.0  0.2 551048 35328 ?        Ssl  10:32   0:01 /usr/bin/python3 -m ipykernel_launcher -f /home/user/.local/share/jupyter/runtime/kernel-33b1ca6c-b09c-41dd-b2fc-c466b2511581.json
user   366855  0.0  0.2 550640 35408 ?        Ssl  10:32   0:01 /usr/bin/python3 -m ipykernel_launcher -f /home/user/.local/share/jupyter/runtime/kernel-a5a7d55e-0ebc-4b4b-aac4-4d1dddff8450.json
user   368190  7.6  1.2 2471816 200372 ?      Ssl  10:45   1:27 /usr/bin/python3 -m ipykernel_launcher -f /home/user/.local/share/jupyter/runtime/kernel-b00685be-189e-4f07-80e0-237ab6772827.json
user   368212  0.0  0.2 550648 43728 ?        Ssl  10:45   0:00 /usr/bin/python3 -m ipykernel_launcher -f /home/user/.local/share/jupyter/runtime/kernel-918a11e0-f81e-4740-a3c1-e5d5ca074570.json
user   369055  4.4  1.3 2076996 219232 pts/0  Sl+  10:57   0:19 /usr/bin/python3 /home/user/.local/bin/ipython
user   369168  2.0  0.3 709300 62112 ?        Sl   10:58   0:08 /usr/bin/python3 /home/user/.vscode-oss/extensions/ms-python.python-2020.5.80290/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
user@laptop:~$ 

Extension version: 2020.5.80290 VS Code version: Code - OSS 1.46.0 (3984852b33bd6897dd83108ac305c567d49e8fda, 2020-05-15T14:46:12.527Z) OS version: Linux x64 5.4.0-29-generic

System Info
Item Value
CPUs Intel® Core™ i7-1065G7 CPU @ 1.30GHz (8 x 1137)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 1, 2, 2
Memory (System) 15.23GB (0.93GB free)
Process Argv –no-sandbox --unity-launch
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:54 (34 by maintainers)

github_iconTop GitHub Comments

4reactions
rchiodocommented, Nov 1, 2021

Perhaps if we change the daemon to start as a process group, it should kill the child process automatically.

3reactions
rchiodocommented, Aug 19, 2021

The root cause of this bug is the daemon’s we spin up to make kernel’s launch faster.

I believe you can workaround the problem by eliminating these files here (copy them elsewhere first in case that breaks something else):

<extension dir>/pythonFiles/lib/python/pyls_jsonrpc
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent a new empty VSCode instance from opening ...
You can demonstrate this by running wsl.exe -l -v from cmd or PowerShell and seeing that it is still in the Running state...
Read more >
Terminal Shell Integration in Visual Studio Code
One of the things that shell integration enables is the ability to get the exit codes of the commands run within the terminal....
Read more >
Basic Editing in Visual Studio Code
VS Code will remember unsaved changes to files when you exit by default. Hot exit is triggered when the application is closed via...
Read more >
Visual Studio Code Frequently Asked Questions
VS Code runs on macOS, Linux, and Windows. ... To learn why Visual Studio Code, the product, has a different license than the...
Read more >
Running Visual Studio Code on Linux
Based on feedback, we have decided to make this setting opt-in on Linux and leave the native title bar as the default. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found