My work development PC is resource-constrained with only 28GB for the main system disk. There is a 1TB external HDD and some data and applications have been moved there.
However, I'm still regularly running into Windows 10 "Low Disk Space" warnings which are triggered when free space drops below ~1GB. While actively working, this happens several times a week. You have to waste time deleting temporary files, emptying the recycle bin, etc.
There are naturally many causes, but the primary culprit in my case and the focus of this question is Visual Studio 2019. Whenever I perform even a simple build (C++ DLL and EXE projects), Visual Studio 2019 creates dozens of files all over the disk. After several days, the number can be in the thousands and GBs in size. Very few of these files appear to be essential - you can generally safely delete them while the project is still open in Visual Studio!
Examples include:
- %LOCALAPPDATA%\Microsoft\VisualStudio\SettingsLogs*
- %LOCALAPPDATA%\Temp_CL_*
- %LOCALAPPDATA%\Temp\dd_BackgroundDownload*.log
- %LOCALAPPDATA%\Temp\dd_updateconfiguration*.log
- %LOCALAPPDATA%\Temp\servicehub\logs*
- %LOCALAPPDATA%\Temp\VSFeedbackIntelliCodeLogs*
- %LOCALAPPDATA%\Temp\VSRemoteControl*
- .vs (eg. IntelliSense database)
and many more.
What steps can I take to:
- reduce (or eliminate) all but essential temporary/cache files
- move temporary/cache file generation to the external disk
- request Visual Studio to clean up after itself when the IDE is closed
Don't bother with unhelpful comments like "get a larger disk". Even with a large local HDD it would be sensible to reduce the number and size of files hitting disk. Given enough time, any disk will eventually run into this problem.