Powerconfig and Windows Hibernation – Part 2

I wanted to post a followup to an earlier post about Windows and disabling the Hibernation feature.  The original power was useful because in many circumstances (like most desktops) you don’t need to or want to hibernate your system.  So, you can save some disk space (upwards of the amount of RAM in your PC) and some performance overhead of managing that hibernation file, by disabling the hibernation function or feature.  You can read that one here.

Next thing I thought about was, what if you do need that hibernation function?  Well, naturally you can do the opposite of that earlier article to enable hibernation if it isn’t already, although usually it is by default.  But also, you can specific how big the hibernation file (hiberfil.sys) is compared to how much memory you have in your machine.  I would imagine if the file is set to less than your memory it must do some compression and maybe leave some non-essential stuff out, but I don’t know for sure and I am not sure if it’s worth digging into too deeply.  However, if you have some binary real estate (disk space) to spare, and you don’t have too much memory in your machine (you guys with 16GB or something need to ditch Windows and run Linux), set it to 100% and rock out.

Just like the enable and disable, you use the powercfg.exe command, and interestingly enough, still use the -H switch.  But instead of just On or Off, you add another switch ‘-Size’ and a number between 50 and 100 to equate to anywhere between 50 and 100 percent of your memory.  According to what I read, you can’t choose less than 50% or, obviously, more than 100%.  So, I set mine to 100% (it was at 75% by default) and am going to see how well it works.  If I see anything that warrants it, I’ll post a follow up as to whether or not it’s a good idea.

OK, the command to set your hiberfil.sys size to 100% would be:

powercfg.exe -H -Size 100

And there you have it, it’s just that easy!  Hope it helps 🙂

Disable Hibernation In Windows

Here is a helpful tidbit for anyone that might need it.  It’s something I used now and then, often enough that I remember the command, but not often enough to remember the exact syntax LOL  At least if I post it here it will be easy to find.  What am I talking about you ask?  Well, enabling and disabling hibernation in Windows.  If you are running a desktop, you most likely don’t need to hibernate your machine.  You can if you want, but I for one don’t want to lose the extra few gigs of disk space taken up by the ‘hiberfile.sys’ hibernation file.  Not to mention the system resource usage and overhead of keeping it updated.

OK, getting down to business, on Windows Vista and Windows 7, you can enable or disable the hibernation function easily by using the ‘powercfg’ command with the ‘-H’ (hibernation) option.  Here are a couple of examples:

powercfg.exe -H off

This turns hibernation off naturally, and:

powercfg.exe -H on

Will turn it on, and just that easily too!

I hope this little trinket of wisdom comes in handy for you.  Enjoy!