DEV Community

Reducing VSCode Memory Consumption

Claudio Davi on June 19, 2019

How to reduce VSCode memory usage I've been using VSCode for quite a while now and one of the most annoying things that I have noticed i...
Collapse
 
joaomoreno profile image
João Moreno

Hey there. VS Code dev here. A few comments:

  • Disabling telemetry does absolutely nothing to reduce memory.
  • There is no search indexing at all. We use ripgrep to provide fast search. Adding stuff to search.exclude reduces no memory at all.
  • Creating workspaces is actually allocating more memory than simply opening folders.

The best thing you can do to reduce memory consumption in VS Code is: install less extensions.

Collapse
 
claudiodavi profile image
Claudio Davi

Hi, thanks for the heads-up, about the telemetry i know it does not affect memory consumption, but I mentioned I could include as a tip for other devs that don't like sharing data.
Great thing that search doesn't index I didn't know that! But removing folders for search greatly improves user experience during search.
For workspaces, I'll give it a go then. Thank you for the tip!!

Collapse
 
ekoetsjarjan profile image
Edward Koetsjarjan

is it possible to see what extensions uses how much memory, the easy way?
was looking but not found any , thank you

Collapse
 
renanprometheusarch profile image
Renan Moura

kkkkkkkkkkkkkkk i dont think so man ... we also write some shit code sometimes ... kkkkk dont be so silly kkkk

Collapse
 
arthurfiorette profile image
Arthur Fiorette

Mano, rir com kkk fora do brasil é errado demais ausdhauishdiashd

Collapse
 
orenmizr profile image
Oren Mizrahi

if everyone removed their telemetry - vscode would be less effective. it helps the VSC team counter issues with the product. i think.

Collapse
 
mohannadk28 profile image
Mohannadk28

if someone got an issue he will probably just report it in the GitHub issues page

Collapse
 
claudiodavi profile image
Claudio Davi

Yeah, I do believe so. But most devs I know are quite savvy about sharing data, so I included this just to warn people that it does share and there's a way to disable it!

Collapse
 
jsardev profile image
Jakub Sarnowski

My tip would be: delete all useless or redundant extensions that you're not actually using 😄

Collapse
 
msfjarvis profile image
Harsh Shandilya

Just implemented this on my laptop and memory consumption has gotten so much better! Even things like searching are significantly faster now. Thanks a lot for sharing!

Collapse
 
claudiodavi profile image
Claudio Davi

I'm glad I could help!

Collapse
 
adilimudassir profile image
Mudassir Adili

Thank you for this. This memory consumption issue has been a pain for me

Collapse
 
claudiodavi profile image
Claudio Davi

It is a pain to us all. Glad I could help!

Collapse
 
zed_m profile image
Amine Hammou

thank you

Collapse
 
sskanishk profile image
Kanish Malviya

Use SublimeText

Collapse
 
codestuff2 profile image
Adam Whitlock

This is a great little collection of tips. Thanks for writing!

Collapse
 
aleccool213 profile image
Alec Brunelle

Was waiting for a long time for this kind of post! Amazing!

Collapse
 
krlyric profile image
Katherine

great topic! thanks

Collapse
 
jankeromnes profile image
Jan Keromnes • Edited

Great tips! Many thanks for sharing them. 🙏

Going further, if memory is still an issue, note that you can also run VS Code on gitpod.io's 60GB RAM servers for free.

Collapse
 
rifaimartin profile image
Rifai Martin

we just need to add some script above to settings.json?

Collapse
 
svankirk profile image
svankirk

yes

Collapse
 
ekoetsjarjan profile image
Edward Koetsjarjan

thank you -500mb

Collapse
 
fnaquira profile image
Favio Náquira

The final script lacks of the telemetry one...

Collapse
 
magmine profile image
Mohammed Amine Maghous

Shouldn't "file.exclude" reduce memory usage, since some files won't be loaded ?