Visual Code RAM Optimized

Jayasingh
2 min readMay 26, 2020

--

Hey, This short guide will help you to save some bucks on upgrading your RAM if you are a developer who uses visual code and facing performance issues and screen freeze.

My laptop configuration is 8GB 512GB i58thGen. My processor is ok-ish for my development needs as well as the snappy SSD storage. But the bottleneck here is the 8GB ram. I am running Ubuntu 20.04 in my system.

Ever since I started this full-stack javascript app development the RAM usage goes all the way to 7.6GB and screen freezes.

To find the issue

I debugged this and found out when VS code starts its taking barely 200–300 Mb which is fine. But as soon I open my backend code it shoots to 1.2–1.5GB and when I run the code using node js it raises the bar to 2.5GB to 3.0GB taking my overall ram usage to 5GB.

Want to read this story later? Save it in Journal.

But I still got some RAM left-right. So I open the frontend code and start the app in development mode. The browser opens up (Chrome) the app and total RAM consumption is 7.6GB and I am just a few procedures away from freezing my laptop and making myself force shutdown and start all over again.

So what is the issue here?

Its the File watcher and node modules. But we can't remove that. And hiding it won't solve anything. And watchers should be running as well so the files can be indexed and searched upon request instantly.

So the solution here is how many times did you want to apply search inside node_modules and bothered about knowing if files inside node_modules got changed. If never or fewer times then you could just ask the watcher to ignore these monster size folders.

To do so you could just copy below

and create a folder called .vscode in the root of your project than a file called settings.json and paste the above code/JSON then restart VSCode.

This has freed up all the memory. My memory usage came down from 7.6GB to 3.2 GB. Now I just have to be careful about no tabs and developer tools I open in Chrome. Maybe I will find a better way for that and share it with you or if you know any comment it down please.

Additional Steps for more free memory

Disable plugins for workspaces where it is not used at all.

Use workspaces in case of working on multiple projects simultaneously.

📝 Save this story in Journal.

👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. Read the Noteworthy in Tech newsletter.

--

--