Is your Windows PC using an extraordinary amount of disk space?

If you have ever saved any audio files to your computer’s hard drive, you will know that these types of files have a tendency to be rather large. This is probably no surprise to anyone, and it wasn’t to me. So, when TechGenix agreed to allow me to produce the TechGenix Xtreme podcast, I thought I was prepared. In addition to a very clean hard drive, I installed an expansion drive as well as a personal cloud environment, which also causes me stress. (But that issue is for another time.) After all of this preparation, imagine my surprise when I recently received a Windows-generated message advising me that I was dangerously low on disk space! How could this possibly be?

Naturally, I did all of the obvious tasks. I emptied the trash, deleted unnecessary duplicate files, and those nasty temporary Internet files. I don’t want anyone to know where I’ve been anyway. Thinking I was brilliant, I did a quick check to see how much disk space I had freed up. Again, imagine my surprise when Windows smugly divulged that I had only freed up under 1GB of space!

Next, I went to File Explorer in an attempt to identify these large files that were causing me stress only to discover that File Explorer does not easily give up Windows files information. Enter TreeSize. This is a free download that actually returns useful data. Awesome… Something that can help me. This is where I discovered that my PC contained two rather large files named pagefil.sys and hiberfil.sys. What on earth do these files do and why are they consuming my drive space? This is like the squatters I pretend are living in my neighbor’s house. I really don’t think that they asked to be there and I suspect that they are making a mess! In fairness, this is not to say that I don’t have any other issues I need to deal with regarding disk space, but these two files in particular were of concern and needed to be dealt with.

Because my friends have stopped answering their phones when I call for free advice (I know you’re at work, Don!), I turned to Google.

All of the documentation I read indicated that if I disable these files in Windows, the files themselves will cease to exist. While in its pure form this is true, there are many gotchas that need to be addressed before the truth finds itself, and we all know that the truth is out there!

What is pagefil.sys?

Pagefil.sys is basically a swap file that works with your PC’s memory. When you run out of memory, it swaps the data back-and-forth theoretically allowing for faster data access. Personally, I believe this feature requires a lot more work. Prior to disabling this “feature” I had been receiving messages indicating that my PC was low on memory. Since I have disabled this “feature,” I no longer receive these messages.

Bottom line, if you find that your PC, or PCs that are part of your enterprise environment, are low on disk space and you have no idea why, this might be it and like me, you may want to disable this “feature.” Here is how you do it.

Step 1: Did you know that if you hold down the Windows key on a PC and tap the Break key (that’s the same as the Pause key), the Control Panel system settings window will pop up? Do it.

Step 2: Select Advanced System Settings

disk space

Step 3: In the Performance box, click the Settings button.

disk space

Step 4: In the Virtual Memory section, click Change.

disk space

Step 5: You have to change two items here. Make sure that Automatically manage paging file size for all drives is deselected AND select the No paging file radio button. Note that you need to click the Set button to get the No paging file to take effect. Why are these things so complicated????

disk space

Step 6: Hit the OK button through all of the many levels that Windows requires us to maneuver. Reboot your PC and buttaboom, buttabing, you are good to go. Check TreeSize to ensure there is no longer a pagefil.sys. I screwed up the first time and had to do it twice. I don’t know why. I drink a lot of wine. Don’t judge me.

And now… hiberfil.sys!

Supposedly, allowing your PC to go into hibernate mode will conserve more energy than sleep mode. Personally, I question why we seem to refuse to turn our PCs off at night. At one point in time a very, very long time ago when the dinosaurs roamed the earth, hard drives were very mechanical devices and turning them on and off would lower their life expectancy. I don’t think we have that problem anymore and I like to turn my PC off. For me, I don’t need sleep mode or hibernate mode and I really need the disk space these files consume.

Do you remember the command prompt? No? Sadly, there is no way to disable hiberfil.sys without the command prompt, and so I am about to reintroduce you. I know, who still uses the command prompt? Apparently, Windows 10 does.

Step 1: To get to the command prompt, you just need to right click the start menu in most Windows versions. Select the Run as administrator option for the command prompt. I found out the hard way that the other one simply will not work. This will open up a command prompt window.

disk space

Step 2: Are you ready? You have to type the following command and hit the enter key. If you get an error message that means either (1) you did not select the admin command prompt, or (2) you may have missed a space, which is what I did the first two times.

Here is the command:

Powercfg.exe –h off

There is a space between the exe and the –h and there is a space between the –h and the off.

Step 3: Hit the enter key and it should look like absolutely nothing happened. Good. Technically, hitting the enter key is not really a step, but I already formatted this document so it is going to be a step.

Step 4: Now you have to once again reboot your PC for this change to take effect. You may be wondering if you can do both of these changes and then reboot. I have no fucking idea! And it took me forever to figure these two things out, so I did two separate reboots.

I would love to say I am writing this to help everyone out, but the reality is that I may never remember all of the steps if I don’t write them down, so this is actually being done for very selfish reasons. This afternoon I received a message from LinkedIn asking if I want to follow Bill Gates. I said no.

Photo credit: Shutterstock

About The Author

8 thoughts on “Is your Windows PC using an extraordinary amount of disk space?”

  1. Actually a lot of utilities can fail miserably when trying to find large files/directories. Reason? These files/directories would have restrictive permissions which would cut-off even admin account from accessing these files/directories. In this case the admin/user needs to take ownership of the files in question and then it will be possible to see real file size and delete large ones when needed.

    As for hibernate mode i think it is a blessing. Say I am working on a large dataset stored in memory for faster processing. Rather than shutting down I put my system into hibernation and when i resume my work, bang, i have my dataset instantly. YMMV

  2. So, tell me why you think you know better how to household resources in Windows better than Microsoft. They’ve got a few engineers working on this for decades….

    1. Amen! I’ve posted extensive replies to try to correct the article in regards to the Windows paging file.

      Disinformation ! I see the “Geek Squad” getting a little bit of business from the people that follow the advice in this article.

  3. That’s rather weird. These sys files usually don’t take more than 2 gigs of memory. They shouldn’t be something that anyone would be worried about.

    Unless you’re using a notebook with a 32 gigabyte drive. I understand why someone like that would want to save every byte that he can.

    But, under “normal” situations, there really is no need to bother with such things.

    1. George,

      The two files referenced in this article for paging and hibernation can vary greatly in their size. The paging file and hibernate file will grow as the amount of RAM on your machine increases.

      Let’s discuss the paging file:
      As I indicated in a comment I left yesterday, the paging file is used by Windows as a substitute for RAM when there is no more RAM available (but more is needed). Using the paging file slows things down because reading/writing to/from a hard drive is slower than reading/writing to/from RAM. When allowing the operating system to manage the page file size, Windows generally has a paging file roughly equivalent to the amount of RAM in the machine.

      Let’s discuss the hibernation file:
      The hibernation file allows Windows to return to the desktop in a state where it was previously left (but the workstation was powered down). Out of NECESSITY, the hibernation file will be as large as the amount of RAM in the machine. This allows a user to power down the machine without having to close all their Windows, save all their work, and power down. Sometimes, people just aren’t in a position to save/close everything and entirely power down only to have to load all the things up they were previously working on.

      Let’s talk about sleep, which isn’t addressed in the article:
      Sleep places the computer into a low-power state and maintains the contents of RAM (using very-little power). This allows the computer to “wake up” almost immediately. The disadvantage of sleep is that sometimes users will never actually power down their computer. The sad fact is that programs and operating systems are never perfect. A reboot sometimes clears up issues, a reboot is also necessary to complete installation of many Windows updates (which will complete to 100% upon the next boot), etc.

      This article should be removed.

  4. I have been trying to cleanup my husbands old laptop that he uses only for email, checking the weather and a little internet browsing has 300gb storage. 268gb are consumed by Windows. All the other apps and file folders take up 28. Yeah, I’d say Windows is a problem.

    1. A fresh install of Windows takes less than 15GB. Any additional space taken is from programs/applications/utilities/pictures that you (or someone else) has installed. I guarantee you that Windows is not consuming 268GB. The operating system is simply not that big. You bought a truck (i.e. “Windows”) and it ran great, but then you put tons of material in the bed of the truck and you expect it to go just as fast? Computers don’t work that way. This article is just…WOW!

      I only recently started using this site and I found some decent technical information on this site. This particular article, blessed by TechGenix, is very disturbing in that it’s just…entirely incorrect! The author, a submitter on a technical website, doesn’t have a clue about how any underlying operating system works, how browsing the internet works (e.g. caching everything you view on the local hard drive), how RAM works. This article is extremely disappointing from a technical website and I must reevaluate my decision to choose this website as a source of (accurate) technical information. There’s some GREAT articles on this site, but this particular article should never have been allowed by “go to print” by any editor with any technical prowess.

      Source – me: Systems and Network Administrator, AWS Solutions Architect, AWS DevOps Engineer

  5. No, no, NO!…NO!!!…NO!!! Do not disable the paging file in Windows! Please don’t tell anyone else to disable the paging file, either!!!

    Disabling hibernation to save disk space is fine; Your computer will no longer be able to hibernate. Disabling the paging file, however, is a HUGE MISTAKE:

    The paging file is used by Windows when it runs out of memory needed to run programs. To be clear (because some people confuse the two things), memory is not the same as hard drive space. When Windows runs out of memory but it needs more to run a given program or process, Windows uses the paging file as a substitute for the extra memory it needs but does not have. This makes the computer run slower when the paging file is used because hard drives are slower than memory (e.g. “RAM”), but the alternative is that you can run a program and then have it crash if you run out of memory while using that program.

    It is horrible, HORRIBLE advice to tell people to disable the paging file in Windows. It can make programs crash, it can make programs fail to run, and it can cause inexplicable errors and/or blue screens with memory-hungry programs as well as any number of poorly-designed programs which users may have installed on their computers.

    TL;DR: This article is incorrect from a technical standpoint. Users should never, EVER disable the paging file in Windows!

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top