Skip to content

hiberfil.sys is sized against your memory, whether you hibernate or not

A hidden file worth many gigabytes that exists on most PCs by default. What it does, what turning it off costs, and the one command that removes it.

5 min read

Turn on hidden and system files, look at the root of C:, and there is a file taking a large share of the drive that nothing explains. On a laptop with 16 GB of memory it can be 6 to 16 GB depending on configuration, and it is there whether or not you have ever used hibernate.

What it is for

Hibernation writes the entire contents of memory to disk so the machine can power off completely and come back exactly as it was. hiberfil.sys is the space reserved for that. Because it has to be able to hold memory, it is sized against how much memory you have.

The part people miss is that Fast Startup uses it too. Fast Startup is on by default on most Windows installs and is why a modern PC boots in seconds: it hibernates the kernel session rather than shutting it down fully. Turning hibernation off removes the file and turns off Fast Startup with it.

Removing it

powercfg /hibernate off

Run that in a Command Prompt or PowerShell opened as administrator. The file is deleted immediately and the space is returned. To put it back:

powercfg /hibernate on

The middle option most people should take

Hibernation can be kept and made smaller. A reduced hibernation file supports Fast Startup but not full hibernate, and it is meaningfully smaller:

powercfg /hibernate /size 40
powercfg /hibernate /type reduced

On a desktop that never loses power unexpectedly, turning it off entirely is reasonable. On a laptop it is a worse trade than it looks, because hibernate is what saves your session when the battery runs out.

Checking what your machine supports

powercfg /a

That lists which sleep states are available and, when one is not, says why. It is the quickest way to find out whether hibernate is even usable on your hardware before you decide to keep paying for it in disk space.

The other system file beside it

pagefile.sys is next to it and is a different thing: virtual memory rather than a saved session. It is managed by Windows, it grows and shrinks, and it should usually be left alone. Removing the wrong one of these two is how a machine ends up short of memory rather than short of disk.

Common questions

What is hiberfil.sys?

The file Windows reserves to hold the contents of memory when the machine hibernates. It is sized against how much RAM is installed, which is why it can be many gigabytes, and it exists whether or not you use hibernate.

How do I delete hiberfil.sys?

Run powercfg /hibernate off in an administrator Command Prompt. The file is removed immediately. Deleting it in Explorer does not work, because the file is in use by the system.

Does turning off hibernation slow down startup?

Yes. Fast Startup uses the same file, so turning hibernation off disables it, and boots take longer from then on. A reduced hibernation file keeps Fast Startup while using less space.

Should I remove hiberfil.sys on a laptop?

Usually not. Hibernate is what preserves your session when the battery runs out. Reducing its size is the better trade on a laptop, and turning it off entirely suits a desktop that is never unplugged unexpectedly.

Read next