Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does visual studio code consume so much disk space?

Visual studio code consumes a lot of disk space during execution:

  • 3GB on start-up.
  • 2GB when running a script (Julia, in my case).
  • When I kill the in-built terminal and rerun the code, the available storage first goes up by 2GB and then down again by 2GB.

When I exit VSCode all of the disk space reappears.

I'm wondering if there is a way to have VSCode consume less disk space.

From previous questions, it seems that VSCode may take up lots of storage in the workspace folder

C:\Users\<user>\AppData\Roaming\Code\User\workspaceStorage

and possibly in a C++ related folder .

C:\Users\<user>\AppData\Local\Microsoft\vscode-cpptools\ipch

Both folders take up no or very little space in my case.

I'm running VSCode version 1.72.2 on Windows 10. I tried to pinpoint the directory(ies) used by VSCode for this kind of temporary storage with windirstat but to no avail.

like image 414
dirk Avatar asked Mar 17 '26 05:03

dirk


1 Answers

After installing all the latest Windows updates and freeing up space on my C drive, I can now run Visual Studio Code with virtually no disk space consumption (about 300MB). I'm not sure if it were the Windows updates or the additional disk space that helped. Anyway, here is how I freed up about 20GB of disk space:

  • I identified the folders, which require most disk space with windirstat.
  • I deleted hiberfil.sys.
  • I manually defragmented windows.edb.
  • I reduced the size of the WinSxS folder.
  • I reduced the file of the windows installer directory with patch cleaner.
like image 72
dirk Avatar answered Mar 22 '26 02:03

dirk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!