2

I know how to turn off hibernation, that's not what I am asking for. I just want to delete and reset size of hibernation size back to zero. When the hibernation is on, the file cannot be deleted. When it is off, the file disappears. How can i delete it without it reappearing with the same size as it had before? I tried cleaning the disks with windows disk cleanup and also tried wiping free space with Ccleaner but after turning on hibernation the file always reappeared with its previous size.

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
Dom
  • 53
  • 1
  • 5

4 Answers4

4

You can change the size of hiberfil.sys using the powercfg utility:

POWERCFG /HIBERNATE /SIZE 100

The size is given as a percentage of your physical memory size. The minimum allowed setting is 40% on Windows 10/11, earlier it supposedly was 50%.

You can read more about these settings in the official documentation.

An earlier question on the topic produced an answer that said the system would BSOD on hibernate if hiberfil.sys is too small. It is unclear if this behavior persists.


Do note that this is no “reset” and hiberfil.sys has never been zero bytes. If you think the file is taking up too much space, I suggest you simply disable hibernation altogether.

Daniel B
  • 60,360
  • 9
  • 122
  • 163
2

If you understand the purpose of hibernation file you will understand why it is so big. As mentioned in comment it is always the size of your RAM because it stores the the content of RAM with the purpose that on next start it will restore those contents and continue the run the computer.

music2myear
  • 40,472
  • 44
  • 86
  • 127
Romeo Ninov
  • 5,319
  • 5
  • 20
  • 20
0

You can't do this. You've already observed how to make the file go away, but when Hibernation is enabled the file WILL exist and it will be the size of the memory.

A file that is already "full size" is more quickly written to, so the file being full size already means hibernation can happen without the additional delay of creating and expanding the file, and also avoids the issues of not having enough space when trying to hibernate.

So the answer is no, you cannot do this.

music2myear
  • 40,472
  • 44
  • 86
  • 127
0
  • Input command in your Start Menu search bar, then select Run as Administrator.
  • Enter powercfg -h off to disable Hibernation.(it will delete it)
  • Enter powercfg -h on to enable Hibernation if desired
Ace
  • 109
  • 2