Where's My Storage? Investigating an Almost Full C: Drive
Janne Kemppainen |Even though my Windows desktop has multiple hard drives and SSD’s it seems that I’m running out of space on the system drive. In this post I’m investigating why I’m running out of free space and what can I safely remove.
My system drive is a 120 GB SSD which has 5.65 GB 4.95 GB of free space right now. It feels as if Windows is eating everything it can as just a while ago I had over 10 GB of free space and even now that I’m writing this article I somehow lost over half a gigabyte!
Power tools
While it’s possible to just use the file explorer and check the sizes of directories from the properties menu there exists a tool that is meant for this exact purpose called WinDirStat.
WinDirStat is a free disk usage statistics viewer and a cleaning tool which helps you (and hopefully me too) find out what is taking all that precious space. The image that you see in the title area is a screenshot of the treemap view of my scanned hard drive.
PatchCleaner is a tool for cleaning up orphaned installer files. It compares the contents of the Windows installer folder against the Windows registry to find patches that are safe to delete.
Overview
So where is all this data? Let’s take a look.
The Windows directory seems to be the biggest one with 27.2 GB used, the majority of which comes from 15.8 GB of installer files under \Windows\Installer
. That seems like a potential place to save some space.
The second biggest directory at 25.2 GB is Users which is 99.9 % from my personal profile. And 77.4 % of that is in the AppData folder. AppData is a place where applications store user specific data. Some potential there too I’d guess.
The two Program Files directories also take good chunks of space that roughly sum up to the same amount that we had in the Users folder. I’ve been trying to install new programs to other drives than the system drive but I still have some old installations that I really should go through.
Then the last folder taking significant space is ProgramData with 12.8 gigabytes. Similar to the AppData folder this is a place where applications store data that is not user specific.
You might also notice that there are also files directly under the drive root. Almost all of it comes from the pagefile.sys
(5 GB) which is used to extend RAM. As I only have 8 GB of RAM I don’t want to disable the page file as that could cause programs to crash when I’m running low on memory. If you have lots of memory disabling the swap file can save a small amount of space.
Program Files
Now that I have an idea what I have on the drive I’ve decided to start by uninstalling programs that I don’t need anymore.
From the Program Files (x86) folder the biggest problem seems to be Microsoft SDKs. It has come with Visual Studio and takes 2.4 GB of space just for the Windows Phone SDK. I think these come from a broken installation of Visual Studio Professional 2012 (I had a hard drive failure many years back).
I also have Visual Studio Community 2019 installed on a different drive. I will remove it first to see what happens and then try to clean up the older version.
After the uninstallation it seems that I’ve recovered some space! The drive now shows 11.6 GB free. The Microsoft SDKs folder lost lots of files but Windows Phone still seems to lurking there so let’s see what we can do about that.
The uninstaller for Visual Studio Professional 2012 was complaining that I need to restart the computer before it can continue. Well it’s not surprising that it didn’t work as the whole installation directory went with the broken drive.
I started removing other programs that I didn’t need anymore. One of those was the Facebook app which I have no recollection of installing myself.
ProgramData
After digging around the Windows Registry I couldn’t find where the uninstaller for the old Visual Studio was actually located even though it could be opened from the “Add or remove programs” page. However, the ProgramData contained a large directory at C:\ProgramData\Package Cache\{7515082B-0B97-331C-9725-9D42EF0DE501}v11.0.50727\packages\MobileTools\WPImages
which hinted towards Windows Phone. It contained an installer file called MobileTools_WPImages_enu.msi
so I right clicked it and selected “Uninstall”. After that I deleted the directory and won 914 MB!
The second biggest package cache (226 MB) was located at C:\ProgramData\Package Cache\{29F259D7-C517-3EED-84B4-237573CFD39C}v11.0.50727\packages\vc_libraryselectablemfc
. After a quick Google search it seemed to be related to Visual Studio. I tried uninstalling but it caused an error message “This action is only valid for products that are currently installed.”, so I deleted it (the modified date for the files was from 2012).
Then there was also C:\ProgramData\Package Cache\{93489CA8-6656-33A0-A5AC-E0EDEDB17C3E}v11.0.50727\packages\professionalcore\Setup
with vs_professionalcore.msi
. This seemed to be also related to the old installation and the attempt to uninstall failed with the same error message so I got rid of it saving another 157 megabytes.
I repeated this for many packages that I could identify to be related to VS 2012. Some of the uninstallers even worked. Others, such as wpsdk_en.msi
, didn’t.
I also noticed that the Blizzard Entertainment folder took almost three gigabytes which consists of download cache from Battle.net. So I decided to uninstall Battle.net because I haven’t played any Blizzard games in a while. Funny enough, the uninstaller didn’t even bother removing those files!
Another surprisingly big chunk of data was found under C\ProgramData\Microsoft
where a folder called HelpLibrary2
took over 1.8 GB. This was documentation for Visual Studio 11 and because I didn’t have the Help Viewer program installed I just removed the files.
AppData
After manually uninstalling what felt like a million packages I went for the AppData folder.
The C:\Users\Janne\AppData\Local\Packages
folder stood out in WinDirStat as it was 3.1 GB. However, the biggest directory there was for Ubuntu on Windows Subsystem for Linux so it’s better not to mess with that.
Steam seemed to be caching data in C:\Users\Janne\AppData\Local\Steam\htmlcache
so I deleted its contents (660 MB). Steam will regenerate what it needs the next time I’m going to run it but hopefully this reduces the amount of data for a while.
The C:\Users\Janne\AppData\Roaming
folder contained quite a lot. The biggest thing was a folder called 25Assist
(3.8 GB). This is actually the installation of America’s Army 2 with a community made installer. The installation location is in the AppData for some reason. I can install it again if I’d like to play later so it got the delete treatment.
I didn’t clear the cache or browsing history for Firefox and Chrome because I like to have the history if I need to find something again.
PatchCleaner
I ran PatchCleaner which reduced the size of the C:Windows\Installer
folder from over 15 gigabytes to just 2.5 GB. I think that in the future I will definitely remember its existence (or find it again by coming back to this article when the computer gets filled up again).
Conclusion
So that took the whole evening but I’m really happy with the results! I think one takeaway here is that old versions of Visual Studio can really leave some junk behind (especially if not uninstalled properly 😅).
Looking at the C-drive on the Explorer again I was actually surprised by the end result. I managed to remove 45 gigabytes of stuff from the system drive!
How much fluff don you have laying around on your system? Share your thoughts down in the comments!
Discuss on Twitter
I just spent the evening digging through my C-drive because it had only 5GB of space left. Ended up recovering 45 GB back. 😎 https://t.co/GDanYhf1LY
— Janne Kemppainen (@pakstech) February 25, 2020
Previous post
Dockerize Your Python Applications (Flask example)