<link href="//fonts.googleapis.com/css?family=Roboto+Slab:700%7CRoboto:700%7CRoboto:normal" rel="stylesheet">

Compress Hibernation File in Windows 10

When hibernation is enabled in Windows 10, the OS creates a file called hiberfil.sys in the root of your C: drive. I would like to share how you can free up disk space by enabling compression on the hibernation file in Windows 10.

Compress Hibernation File in Windows 10

What is the hibernation file in Windows 10

The hiberfil.sys stores the contents of memory (RAM) when you hibernate your PC. When you resume from hibernation, Windows 10 reads this file again and transfers its contents back to memory. Because memory capacities on modern PCs are always increasing, the hibernation file takes up considerable disk space.

Although you can disable hibernation and use sleep state or always keep your PC powered, it’s not an energy-efficient way for mobile PCs. Also, some features like Fast Startup in Windows 10 depend on hibernation being enabled to boot the OS faster. If you disable hibernation, you lose the benefits of fast boot.

To solve the problem of increasing RAM capacities, Microsoft added the ability to compress the hibernation file in Windows 7. This means that the C:hiberfil.sys file does not take as much disk space as your RAM capacity. It can take significantly less disk space, even 50% of your installed RAM capacity. This is a fantastic improvement Microsoft has made in Windows 7 and later, but it’s turned off by default. Let’s see how to turn it on.

How to compress the hibernation file in Windows 10

  1. Open an elevated command prompt. open-elevated-command-prompt
  2. Type the following command:
    powercfg hibernate size NN

    where NN is the desired hiberfile.sys size in percentage of the total memory.
    compress-hibernation-file-in-windows-10 For example, if you have 8 GB of RAM installed and you want to set the hibernation file size to 60% to save disk space. Then simply use this command:

    powercfg hibernate size 60

    This will set the hibernation file to 60% of 8 GB of RAM, meaning only 4.8 GB. It will save you 3.2 GB of disk space.

Even if you have only 4 GB or 3 GB of RAM, setting this to 50% will save you 2 GB or 1.5 GB of disk space respectively. So this is a very cool optimization you can always make on every Windows system. You will have more free space on your C: drive than before.

How to undo the hibernation file compression in Windows 10

  1. Open an elevated command prompt. open-elevated-command-prompt
  2. Type the following command:
    powercfg hibernate size 100

    decompress-hibernation-file-in-windows-10

This will disable the hibernation file compression in Windows 10. That’s it.

The same can be done in Windows 8.1 and Windows 8.

Source

Leave a Reply