WTFriday: What happens when Windows runs out of Disk Space?

February 17, 2012 by . 13 comments

I have been using the Windows 8 Developer Preview for about 5 months or so and in order to install it on my PC, I had to create a rather small partition on my primary hard drive consisting of only about 16GB. Thankfully, a clean install of Windows 8 will fit comfortably within that space and still provide enough room for some basic utilities and drivers (of course, I do have other secondary partitions that I use for installing applications).

During the installation of a particular application, the free disk space on the partition dropped to about 28MB. One of the users over in the Root Access chat room suggested that I try filling the disk until it is completely full and then blogging about what happens – hence this article. I was a bit reluctant at first since I didn’t want the hassle of reinstalling anything if it became corrupted somehow, but since I have up to date backups of everything, I decided to proceed anyway.

The first step was to run Disk Cleanup to make sure that the disk wasn’t full of a bunch of transient temporary files or something silly like that. Then the next step was to actually fill the disk. This sounds like an easy task, but Windows is pretty good at preventing the disk from becoming full in the first place. After filling the disk to within 500KB, I suddenly discover that Windows has managed to free 300MB on its own. This shocked me because I had just run Disk Cleanup and there was (as far as I was concerned) very little that Windows could remove. I did however receive a notification in the system tray:

Low Disk Space Popup

I began filling up the remaining 300MB of disk space with more files and finally managed to get the disk to 0 bytes of free space for a brief moment:

0 KB of Free Space

Properties of a Full Disk

As you can see, the drive is completely full. But not so fast – I had hardly finished doing this when Windows somehow (miraculously) managed to free up another 308MB of space on the drive. I was beginning to wonder what was getting deleted at this point since I had no idea what was on the disk that took up so much space yet was not needed and could be deleted. Still puzzled, I filled the disk up once again and began launching programs and doing things that I would normally do to see if anything was broken or wouldn’t work. The results were quite interesting.

The first application I tried, Notepad++, was completely unhelpful since it would happily report that it saved a text document – only to find out later that it had silently failed and created a completely blank document. Another text editor, PowerPad, was a little bit more helpful when trying to save a file when there was not enough room:

PowerPad Error

The error message does contain the root of the problem though the additional technical details aren’t really helpful to an end user. When trying to save a web page with Internet Explorer 10, I was pleasantly surprised to see the following:

Internet Explorer Error

This error message was simple but completely accurate – a very good example of what an application should do when it encounters such an error. I began to try a few other applications and all of them were able to at least start without crashing or running into an unrecoverable error. iTunes was able to load my library and play / stream music though it did warn me:

iTunes Error

Some more experimentation revealed little other interesting results – applications worked fine until they attempted to write to the disk in which case they would present some form of error message (well, all except for Notepad++). However, I was surprised to discover that every time Windows tried to scavenge some free space, it never touched the recycle bin which had about 30.1MB of data in it. I would have thought that would be one of the first places Windows would look to free space.

After I was satisfied that my experiment was finished, I deleted all of the files I had used to fill the drive and I am sure I heard the PC breathe a sigh of relief as free disk space shot up to a more reasonable number.

In closing, I would like to share a rather curious message that popped up once I had finished with my experiment and was deleting files:

Disk Space Issue Resolved


Subscribe to comments with RSS.

  • MBraedley says:

    I have the distinct feeling that the free space you were seeing was the page file being freed. I don’t think disk cleanup touches the page file, as deleting something that might still be in use is risky. OTOH, not having free disk space can also be dangerous.

  • iglvzx says:

    Did you save the screenshots to a separate partition when you ran out of space?

  • Yes, I saved the screenshots to a separate partition – although that actually had some problems of its own. Microsoft Paint would save a corrupt PNG file even when using a different partition (I have no idea why – but it was consistently reproducible). What I ended up doing (yes, there are much better image editors out there – but Paint is handy for just saving a quick PNG screenshot) was pasting the screenshots in multiple instances of Paint and then saving them after freeing up some space on the primary partition. Strange – but it worked.

  • I bet you that Windows was compressing some files in the background, or it had some kind of temporary files it was able to remove that aren’t easily found…

  • Bob Bobson says:

    You want to know what happens when the system drive runs out of space? You should have just asked; I have had this happen countless times over the years.

    The primary symptom (at least in XP) is that the user profile cannot be loaded and a new, temporary, blank one is created. This is extremely frustrating because it requires messing with the registry to reset the paths to point to the original/old user profile.

    Also, if there is really no space (ie 0-1KB free), then Windows won’t load at all. That is, LSASS and/or CSRSS may crash and give an error. (In fact, all sorts of seemingly “critical” errors during Windows boot-up are simply due to low disk space and don’t really do much/any harm.)

    Of course the solution is to free up at least 1MB or so of space so that you can boot into Windows at all, then from there you can try to free up more space.

  • says:

    I am constantly getting those messages after I salvaged data from a broken (usb plug kept coming out) wd passport. Curse you, WDC for not making the enclosure removable. I need to buy a new external drive.

  • Ryan Lantzy says:

    I believe some of the free space that you observed after your initial attempt to fill the drive was Windows purging it’s installer cache.

    In the location Windows is stored on the disk, there are all kinds of cached files from installed applications. I think this includes installers from Windows Update, .NET Framework, and other sources.

    While not necessary, I think the OS keeps them around because they may come in handy for going back to a restore point or what not.

  • Camilo Martin says:

    Even with all the sound arguments here, I really think it’s the page file. I don’t think Windows will delete installers (it is actually dangerous to do that sometimes) nor that it will try to compress files suddenly, moreso because that wouldn’t get you instant 300MB (unless it’s faster than I expect and it’s an SSD).

    So I’m with MBraedley.

    • @Camilo: That’s a reasonable suggestion except I explicitly moved the page file to a separate partition prior to performing this experiment – so removing / shrinking it wouldn’t have freed up 300 MB of space on the partition that was filled.

  • Arne says:

    had you disabled VSS and flushed all shadow copies ?

  • Jet says:

    George are you sure that “pagefile.sys” was missing in that partition? It could stay there even after you move it to another partition (it deletes after reboot?). And I suggest there was also “hiberfil.sys” (hibernation file) which takes a lot of space too. Or maybe that 600MB was in Recycle Bin?

    This will probably make it more clear where are those mystic MBs: 1) Disable/Move page file to another partition, 2) Disable hibernation (cmd -> powercfg -h off) 3) Reboot, make sure these files are not there (delete if they exist): pagefile.sys, hiberfil.sys 4) Empty recycle bin, run CleanManager (cmd -> cleanmgr), remove old restore points 5) Fill!

    Have you done all these steps? or maybe smtg was missing? (What about doing it again? ;))

  • NTFS does free some reserved metadata space when the disk gets full since with full disk this reserved metadata space would not be of use anyway.

    A bigger curiosity for me is that NTFS also often eats away lot of space that really should be free – to the point of having zero free space left. That “eaten away” space is miraculously reclaimed after reboot so much that sometimes even over 100 GB may be free again, lets say for example on a 600GB drive. Closing open file handles to big files does help sometimes too, but not as much as rebooting.

  • Leave a comment

    Log in
    with Stack Exchange