Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does VS Code require so much memory? How can I make it run more memory-efficiently?

Does anyone know how to make VS Code use less memory?

It´s taking more than 2gb, sometimes more than 3 gigabytes to have some 8 files opened.

enter image description here

like image 886
Adriel Werlich Avatar asked Dec 06 '18 19:12

Adriel Werlich


2 Answers

I'm on the VS code team.

There are many possible causes for high memory usage. We've put together tools and a guide that can help you investigate potential performance issues.

Start by using the process explorer. The process explorer shows the cpu and memory usage per child process of VS Code. Open it with the Open process explorer command. The process explorer should help you track down which processes are using the most memory. Often times, an extension will turn out to be the root cause

enter image description here

Also, even though you have only opened eight files, your workspace seems to be quite a bit larger than just those eight. Providing intellisense and other advanced editor features often requires processing many unopened files as well. Whether or not the 2-3gb is justified or not is hard to say without understanding what extensions you are using and what your workspace contains.

I recommend that you also take a look through the rest of our performance issue guide. It explains how to report performance issues and further investigate performance problems.

like image 144
Matt Bierner Avatar answered Oct 20 '22 19:10

Matt Bierner


You could prevent vscode from watching folders with really many files in you project by adding this to your json settings file

"files.watcherExclude": {     "**/.git/objects/**": true,     "**/node_modules/**": true }  
like image 44
Cengkuru Michael Avatar answered Oct 20 '22 20:10

Cengkuru Michael