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

Adriel Werlich picture Adriel Werlich · Dec 6, 2018 · Viewed 48k times · Source

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

Answer

Matt Bierner picture Matt Bierner · Dec 7, 2018

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.