Is Hiberfil.sys Safe to Delete? [Quick Removal Guide]
Most computer users with some form of knowledge quite like to keep their system running smoothly, and that includes cleaning out junk and old privacy files with tools like CCleaner to keep the hard drive clean from useless data. While looking around the root of your C drive, a couple of files you might come across which will be quite big in size are hiberfil.sys and pagefile.sys. You won’t be able to see them without showing hidden files in Windows folder options first, using a file manager or typing “C:” into the address bar to show hidden files in a web browser.
The size of these files actually will depend entirely on the amount of physical memory (RAM) there is in your computer because they are set automatically by Windows according to how much you have. If you use a large capacity hard drive for your Windows partition this won’t be a problem. But if you have an SSD or a smaller hard drive, this can become an issue when space is at a premium and these files are consuming several Gigabytes between them taking up a large percentage of available space.
So, just what are the hiberfil.sys and pagefile.sys files and how can I remove them from my system? How safe is it to delete hiberfil.sys and pagefile.sys?
Here are the answers to the questions above.
The Hibernation File (Hiberfil.sys)
Hiberfil.sys is a file the system creates for the computer to enter hibernation mode. Hibernation copies everything stored in the computer’s memory and writes it to your hard drive in the form of the hiberfil.sys file. That’s the reason why the computer is quicker when waking up from hibernation than a standard Windows boot because the computer is only loading this file back into memory. Some of you will know this is partly how Windows 8 can manage to boot faster than Windows 7 and Vista because it uses hibernate to do so.
If you have 2GB of memory, then hiberfil.sys will be around 2GB in size, big enough to copy the current contents of memory to the file. Even if you don’t intend to use the hibernation feature, hiberfil.sys will still take up this huge amount of disk space and you cannot move it to another drive, not ideal if you have a small drive or SSD and a large amount of memory. Hibernation is enabled by default in Windows and if you don’t intend to use this feature, you may as well switch it off to free up the drive space.
Turn off Hibernation in Windows XP
Hibernation can easily be disabled in windows XP and it’s simply a single option accessible through the Control Panel.
1. Go to Control Panel and run Power Options. Or right click on the Desktop and go to Properties -> Screen Saver tab -> Power.
2. Click on the Hibernate tab and uncheck “Enable hibernation“.
The hiberfil.sys file will be automatically deleted after you press OK and you’ll get back whatever hard drive space it was consuming. It will tell you how much Disk space will be saved in the window as you can see above.
Turn off Hibernation in Windows Vista, 7 and Windows 8
The hibernate feature in windows Vista and above is slightly more difficult to get at because you can’t delete it through the Power options in Control Panel. It can easily be removed however, by using one of the two methods below:
The easiest way is to download and run a Microsoft Fix It tool which has been developed just for enabling or disabling hibernation. Simply download and run the tool and depending on which one you use, the hiberfil.sys will be either created or deleted from the C drive.
Microsoft Disable Hibernation Fix It | Microsoft Enable Hibernation Fix It
The other option is to use Windows Command Prompt.
1. Open a Command Prompt with administrator privileges by clicking on Start and typing “cmd” into search. Then hold Ctrl+Shift and press Enter.
2. Type the following:
Powercfg -h off
This will immediately disable hibernate and the hiberfil.sys will be deleted. To reverse the procedure, use “powercfg -h on”.
Changing the Size of Hiberfil.sys
By using the same Powercfg command above we can also reduce the size of the hiberfil.sys so it doesn’t automatically set itself to the same size as the amount of installed memory. Use the following command:
Powercfg -h -size {percentage number 50 – 100}
Setting the percentage to the lowest allowable of 50 will set the hiberfil.sys to half that of your installed memory, 75 to three quarters etc. Do be aware that this does come with its own issues because if you have more memory currently in use than the hiberfil.sys has been allocated, data loss and system problems will occur coming out of hibernate because it hasn’t saved the whole contents from RAM.
On Page 2 we show the solutions for dealing with the Pagefile.sys file.
Hi there,
Having tried this, in Windows 10, I still get an error: unexpected error occurred. This after doing the CMD bit to open the DOS window
run cmd as an administration
command: poweecfg -h off
thank you master, nice tutorial.
What about for Windows 10?
To disable Hibernation, I meant
Yes, the same method.
J:\users\Tim\Powercfg -h -size 50
Access is denied.
You haven’t opened an administrator Command Prompt.
run command prompt as administrator
Thank so much . It is useful to know reduce the file size in the partitions.
changing pagefile location is very dangerous, this have resulted in deleting my ‘D’partition when my PC frozen and then when i restarted the whole partititon was deleted
Changing pagefile location is perfectly safe as it makes no difference what drive the file is on. The issue you had was not related to the pagefile location itself but was something else.
Nicr tutorial, just what i needed to fix that page file thing.
Hi I have moved the pagefile sys to a second internal standard hdd that only is used for data and I removed the Hybernation mode from my systems ;; saved me over 7 Gb on a small SSD hdd ;; runs a lot faster now ..
thx for the explains
Great! Thanks!
Thank you very much. Works great! My pagefile.sys was using 2.79GB–changed to 50-percent–saved valuable gigabyte-plus.
Thank you! Saved 15GB on a 128GB SSD drive.
Great help! Thanks a lot
Thanks for the help. You’re info and graphics are very good and you make it easy to follow and understand. This is often not the case!
Thanks
Thanks!
What about pagefile.sys?
The article has 2 pages…
See page 2
it says you dont have permission?
What are you doing to get that message, playing around with Hiberfil.sys, Pagefile.sys or System Volume Information??
Thanks, Raymond, for the command prompt solution to turning off hibernation. It seems to have worked. However, if anyone else gets an error message about not having privileges, I found out that you have to run command prompt as administrator. Right click the program Icon and choose “Run as administrator.” I hope this helps someone.
Thank You Raymond …saved 3gb ..
I learned many things about virtual memory and hibernate files.
Very clear information to understand.
Thank you
very usefull
thank you
Thank you .
thanks ..
You r really awesome!!! thanks.
Thank you Raymond for your help…
Thank You…..
So, I moved the pagefile.sys succesfully. It’s now on the D drive.
Can I erase without problems the pagefile.sys from my C drive?
Thanks.
Yes you can, once it’s on a new drive, the pagefile on C is of no use anymore.
Dear Mr. Raymond,
I also have tried to use the file Microsoft Fix it 50466 for diasabling the hiberfil.sys but in vain.
The message says:
The tool Microsoft Fix it cannot be used on your operating system or on your application version.
What to do?
My hiberfil.sys has 12,37 GB due to 16 GB RAM…..
Please help me to solve this problem because I am short of free space on disk C:.
Otherwise I would have to remove the Window partition, to make a bigger one and to install the new Windows 8.
Many thanks for your advice,
Ing. Pavel Sič
Even though you’re the administrator, have you tried running the command prompt as admin (right click, run as admin)? For some strange reason this sometimes works even if you already have full rights.
If that fails, try to do the same from Safe Mode, sometimes backup or security software can lock the hiberfil.sys and not allow you to delete it.
If that also fails, create a new admin account and see if you can delete from there, your current account may have a security permissions problem.
After typing C:\Users\Dragon>powercfg -h -size 50 >>> Access denied ……
After typing C:\Users\Dragon>powercfg -h off:
AN UNEXPECTED ERROR CONDITION HAS OCCURED. UNABLE TO PERFORM OPERATION. YOU MAY NOT HAVE PERMISSION TO PERFORM THIS OPERATION.
In spite of I have the administrator´s rights on the whole disk C:\, however, I have no rights to access to hiberfil.sys and pagefile.sys. I am not able to abandon the file security of the both files.
Please give me advice.
I have two Windows 8 systems on my notebook, perhaps I´ll be sucessful on the other system….
Many thanks for your kind answer
Hi PS,
create shortcut for DOS prompt on desktop then run this CMD as administrator. when you right click on this DOS shortcut you will get option “Run as Administrator”. Now you can use
Powercfg -h off
THANK YOU..!!!!!!!!!!! Really HELPED!!! :)
Thank you for this information. really helped.
thanks buddy…..
Great thanks … It’s working great !!
Thank You very much!!!
thanks raymond.
Thank you, ever so much for really helpful advices
thanks for the additional knowledge. It will help me to save space if I would not use big programs. You’re the best man! Thanks again.
Thanks for the info on that Raymond :) I’d never used hibernation before today, and needed to see what that BiG new file was related to. It’s all gone now ;)
I just wanted to add a few bits, in case it’s of interest to anybody. Photoshop shouldn’t (in theory) be affected by having no pagefile, as it uses its own ‘scratchpad’ file area. Some of my more extravagant customers I have, use a completely separate SATA drive for just that single purpose, though their fast PCs make it hard to see any notable difference. I’ve not used AutoCAD, so can’t comment on that one.
Regarding the idea of completely switching off the pagefile, I’ve played with this on a few machines, and found XP Pro seems happy with it, till it gets pushed (i have 2GB DDR2 fitted).
I think Microsoft have assumed all along that it’s a required safety net, and the system actually depends to some degree on it being available. We can see how badly Windows is setup in dealing with used memory, by its effects after copying a full CD/DVD – watch it try to wake back up even after the software is exited.
Just curious, does anybody know of a utility that wipes memory on ‘application exits’ safely? i’ve tried many, but all cause instability (or no effect) – i assume they all clean some bits of data in error maybe?
What I’d like to see, is a memory manager, to lock specific applications memory area & usage. So Windows doesn’t waste so much time shuffling & searching. If NERO (example) was locked at the 1.5Gb memory page & limited to 100Mb application use, it would be far more efficient i reckon (based on old style programming ways from years ago).
One last point (hope I’ve not ranted for too long)…… Regarding speed differences, the speed is entirely down to the individual PC, based on drive transfer capabilities, and memory speeds (EDO/DDR types etc.), and also, it’s worth mentioning that XP is naturally setup to give most physical memory up to ‘programs’, and not for the ‘system’, though this setting is changeable. I wonder if ‘system’ would include the pagefile? I will have to investigate.
Thanks again Raymond, excellent website :)
(and VISTA is so yucky, I think).
This one is a nice one.
Thank you Raymond
nice stuff
thanks raymond. at least i can free up my disk space