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.
-
2The hibernation file is always the size of how much ram you have. – LPChip Sep 01 '22 at 12:02
-
Why? What are you trying to accomplish doing this? The file exists for a reason, and is the size it is for a reasons. – music2myear Sep 02 '22 at 03:38
4 Answers
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.
- 60,360
- 9
- 122
- 163
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.
- 40,472
- 44
- 86
- 127
- 5,319
- 5
- 20
- 20
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.
- 40,472
- 44
- 86
- 127
- 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
- 109
- 2
-
OP already notes they know how to disable hibernation and that is not what they're asking about. – music2myear Sep 03 '22 at 03:58
-