What happen if we reduce the size of hiberfil.sys

I today discovered that we can set the size of the hiberfil.sys using powercfg -H -size 100% command line tool. Ignoring the hard space you will get, what else will change if we set it to powercfg -H -size 50%? Does it limit max RAM usage to 50%? Will system doesn't hibernate if I we more than 50% of RAM?


I have found a Microsoft document regarding the hibernation file. What it tells us is that the contents of memory are compressed before being dumped to the hibernation file so most of the time setting a lower percentage size of the hibernation file is beneficial as less disk space is wasted.

Windows supports hibernation by copying the contents of memory to disk. The system compresses memory contents before preserving them on the disk, which reduces the required disk space to less than the total amount of physical memory on the system.

The correct syntax for the command appears to be:

PowerCfg.exe /HIBERNATE /SIZE 75

The document also states that if the hibernation file is too small then a "Stop Error" will occur and the codes will suggest how much you need to increase the hibernation file size by.

Doing this will not limit the amount of physical RAM available to your system.

As it is compressed then reducing the size of the file will not be problematic if you only rarely hit 100% of physical memory used and/or your memory is likely to contain data that is reasonably compressible which most of the time it should be.

From that document:

Windows reserves disk space for hibernate in the hibernation file, which is named Hiberfil.sys. For Windows 7, the default size of the hibernation file is equal to 75 percent of the total physical memory on the system. For example, on a computer that has 2 GB of RAM, the default hibernation file size is 1.5 GB.

In rare and extreme cases of memory use, including memory validation by a memory performance or test utility, hibernate can fail because the contents of memory cannot be compressed enough to fit within the size of the hibernation file.

I would give it a try at lower numbers but personally I wouldn't go as low as 50%. It might well be fine though and the worst that will happen is that hibernation will fail and you'll have to reboot normally and set the size to be a bit larger.


The syntax in Windows 10 is slightly different

PowerCfg /h[ibernate] off

will switch off the hibernation and removes the file C:\hiberfil.sys

PowerCfg /h[ibernate] on

Will switch the function back on and creates the file C:\hiberfil.sys of about the same size as available memory (a 16GiB RAM system creates a 15.9GiB sized hiberfil.sys)

PowerCfg /h[ibrnate] size 75

Will create a hiberfil.sys file or reduce its size to roughly 75% (12GiB)

PowerCfg /h size 100

Is in effect the same as switching the feature on

A size value greater than 100 results in a parameter error message, a size smaller than 40 set the effective size to 40%.