microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.32k stars 1.18k forks source link

VS Code helper remains running after quitting with high CPU load #20356

Closed realluigi closed 1 year ago

realluigi commented 1 year ago

Type: Bug

Οn MacOS VS Code helper remains running after quitting VSCode with high CPU load. Opening VSC and exiting creates multiple istances of helper. VSC unusable.

VS Code version: Code - Insiders 1.75.0-insider (1cf6a0823e31e26b55882af02afd41c650d461b8, 2022-12-07T20:55:43.335Z) OS version: Darwin arm64 22.2.0 Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|4, 5, 7| |Memory (System)|16.00GB (0.24GB free)| |Process Argv|--crash-reporter-id 6a2da10a-689a-467a-b624-b354d9b17239| |Screen Reader|no| |VM|0%|
Extensions (10) Extension|Author (truncated)|Version ---|---|--- language-julia|jul|1.38.2 vscode-docker|ms-|1.23.1 isort|ms-|2022.8.0 python|ms-|2022.20.0 vscode-pylance|ms-|2022.12.20 jupyter|ms-|2023.1.1003411034 jupyter-keymap|ms-|1.0.0 vscode-jupyter-cell-tags|ms-|0.1.6 vscode-jupyter-slideshow|ms-|0.1.5 remote-containers|ms-|0.266.1
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256198 vslsvsres303:30308271 pythonvspyl392:30422396 pythontb:30258533 vsc_aa:30263845 pythonptprofiler:30281269 vshan820:30294714 pythondataviewer:30285072 vscod805cf:30301675 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30404738 cppdebug:30492333 vsclangdf:30492506 c4g48928:30535728 dsvsc012:30540252 pynewext54:30618038 pylantcb52:30590116 pyindex848:30611229 nodejswelcome1:30587009 pyind779:30611226 dbltrim-noruby:30604474 pythonsymbol12:30622696 fim-prod:30623723 ```
deepak1556 commented 1 year ago

Can you provide the full command line of the helper process with high CPU usage.

realluigi commented 1 year ago

It just get started every time I start VS code and remains running, multiple instances of it (I need to kill it with Activity Monitor). It just shows up under Activity Monitor as “Code - Insider Helper (Plugin)” with CPU% > 98% when other processes are idle.

On 8 Dec 2022, at 02:57, Robo @.***> wrote:

Can you provide the full command line of the helper process with high CPU usage. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

deepak1556 commented 1 year ago

Code - Insider Helper (Plugin) indicates its from an extension host, can you run extension bisect https://code.visualstudio.com/blogs/2021/02/16/extension-bisect#_welcome-extension-bisect and narrow down which extension is causing the issue. Thanks!

realluigi commented 1 year ago

Thanks. I have now tried this. I go through the steps and it ends with "Extension Bisect is done but no extension has been identified. This might be a problem with Code - Insiders.” There are now five separate instances of "Code - Insider Helper (Plugin)” running.

On 9 Dec 2022, at 12:27, Robo @.***> wrote:

Code - Insider Helper (Plugin) indicates its from an extension host, can you run extension bisect https://code.visualstudio.com/blogs/2021/02/16/extension-bisect#_welcome-extension-bisect and narrow down which extension is causing the issue. Thanks! — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

deepak1556 commented 1 year ago

Does the issue repro when you run with code --user-data-dir /tmp/vscode-temp --extensions-dir /tmp/vscode-temp-extensions ?

realluigi commented 1 year ago

Thanks. I found the offending extension by enabling/disabling them one by one, quitting, killing any residual process, going back in, and so on: it is actually MS Python (+ Pylance + isort). If I disable it, the problem disappears - no high-CPU running plugin left after quitting. Jupyter notebooks works fine without the extension (but only Julia available). I have tried both pre-release and release versions of the extension, and the problem is present for both. Bisect doesn’t work because the problem shows up after quitting VSC. Either a bug in the extension or in how VSC interfaces with it.

On 9 Dec 2022, at 12:45, Robo @.***> wrote:

Does the issue repro when you run with code --user-data-dir /tmp/vscode-temp --extensions-dir /tmp/vscode-temp-extensions ? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

deepak1556 commented 1 year ago

Thanks for figuring out the extension causing the issue. Can you take a profile of the extension before quitting VSCode when it is showing high CPU usage following the steps at https://github.com/microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

/cc @rebornix for the python extension

brettcannon commented 1 year ago

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.