13

It happened today when I suddenly noticed processes started getting slow on the computer. So I checked Task Manager to see what causes it.

Enter image description here

I have waited a couple of minutes to see if it changes by keeping Visual Studio Code in idle state and then my computer dumps the memory in BSoD (blue screen of death).

After rebooting, I tried the same way to reproduce the state and within 20~30 minutes, it is up to 5 GB.

Enter image description here

0 909 4452 c:\Users\arbaz\.vscode\extensions\ms-python.python-2018.12.1\languageServer.0.1.72\Microsoft.Python.LanguageServer.exe

What are the possible reasons causing this and how do I fix it?

Latest version:

Version:   1.30.0 (system setup)
Commit:    c6e592b2b5770e40a98cb9c2715a8ef89aec3d74
Date:      2018-12-11T22:29:11.253Z
Electron:  2.0.12
Chrome:    61.0.3163.100
Node.js:   8.9.3
V8:        6.1.534.41
OS:        Windows_NT x64 10.0.17134
Version:          Code 1.30.0 (c6e592b2b5770e40a98cb9c2715a8ef89aec3d74, 2018-12-11T22:29:11.253Z)
OS Version:       Windows_NT x64 10.0.17134
CPUs:             AMD Ryzen 7 1700 Eight-Core Processor   (16 x 3000)
Memory (System):  15.95 GB (3.87 GB free)
VM:               40%
Screen Reader:    no
Process Argv:     C:\Users\arbaz\AppData\Local\Temp\tasks.py
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                enabled
                  video_decode:                 enabled
                  video_encode:                 enabled
                  webgl:                        enabled
                  webgl2:                       enabled

CPU %   Mem MB     PID  Process
    0       66   14620  code main
    0       84    1092     gpu-process
    0       51    6332     shared-process
    0      199    8312     window (tasks.py - Visual Studio Code)
    0       85   11724       extensionHost
    0     2278    4452         c:\Users\arbaz\.vscode\extensions\ms-python.python-2018.12.1\languageServer.0.1.72\Microsoft.Python.LanguageServer.exe
    0        5   11296           console-window-host (Windows internal process)
    0      187   14320     window (Process Explorer)

Extensions:

Extension              Author       Version
                       (truncated)
-------------------------------------------------------
better-comments        aar          2.0.3
vscode-django          bat          0.17.0
unique-lines           bib          1.0.0
python-extension-pack  don          1.4.0
permute-lines          ear          0.0.10
MagicPython            mag          1.1.0
python                 ms-          2018.12.1
vscodeintellicode      Vis          1.1.2
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Arbazz Hussain
  • 1,622
  • 2
  • 15
  • 41
  • You may want to [edit] your question to reflect the exact versioning of Visual Studio Code you're running. It looks like there are [many](https://github.com/Microsoft/vscode/issues/50280) [possible](https://github.com/Microsoft/vscode/issues/44143) memory leak issues being tracked - but across several versions. – gravity Dec 17 '18 at 20:58
  • Updated, I'm on the latest version. – Arbazz Hussain Dec 17 '18 at 21:01
  • It is an ohmigod question. Time to reformat the disk drive. Nuke from orbit, only way to be sure. – Hans Passant Dec 17 '18 at 23:33
  • Removed all extensions & Cleaned extension directory solved my problem, I read somewhere in github that it is caused due to missing of libraries/files that extensions are required which cause the extensions to loop over looking for required files. – Arbazz Hussain Dec 18 '18 at 03:20
  • Does this answer your question? [Why does VS Code require so much memory? How can I make it run more memory-efficiently?](https://stackoverflow.com/questions/53658769/why-does-vs-code-require-so-much-memory-how-can-i-make-it-run-more-memory-effic) – Akib Azmain Turja Nov 14 '20 at 11:05

2 Answers2

9

This issue is mostly caused by the extensions.

Try to monitor menu HelpOpen Process Explorer for a certain period to see which process name is taking large memory.

Try uninstalling all extensions and removing all their junk from %USERPROFILE%\.vscode\extensions for windows.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Arbazz Hussain
  • 1,622
  • 2
  • 15
  • 41
  • It was Volar extension that was using a lot of memory in my case. This really helped. Thanks! – KCP Aug 29 '22 at 17:47
4

This problem happened to me yesterday. I managed to fix the problem, but I am not sure if my solution applies to yours. I'm using Windows 10 and Visual Studio Code version 1.33.1.

The solution is to go to settings and enable jedi. The culprit that was consuming excessive RAM was Python language server. So, by enabling jedi, instead of using the Python language server for the intellisense function, jedi was used instead.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
  • Thanks. This was exactly my issue. I uninstalled the Visual Studio IntelliCode extension and set my `"python.jediEnabled": true` and memory is now staying at a reasonable level. – Nick Gotch Jul 10 '19 at 14:58
  • 1
    @Nick I did not need to uninstall anything. Enabling jedi alone was enough. – guagay_wk Jul 10 '19 at 15:12
  • I have already jediEnabled = true, I'm using Ubuntu and having the same issue – Ernesto Alfonso Jan 21 '20 at 14:38
  • Thanks for the solution. I searched for "Jedi" in setting to find the "Python Language Server" option, but Setting it to Pylance worked for me. – SaeedM Oct 26 '20 at 21:40