What are hiberfil.sys and pagefile.sys files, and can I safely delete them?

54

15

I noticed two big (~ 2GB) files (hiberfil.sys and pagefile.sys) at the root of my C: drive and wondered what they were. I searched on google and found some interesting links, but did not find any answer on this site. I guess it would be good to have this question answered here for future reference.

Here are my questions:

  • What is the file hiberfil.sys for?
  • What is the file pagefile.sys for?
  • Can I safely delete these files?

marco-fiset

Posted 2011-11-22T18:22:33.887

Reputation: 819

3aaakkk, why do people always want to delete system files. – Moab – 2011-11-23T00:32:57.193

3@Moab : Because these files take up a lot of space on my somewhat low-capacity hard drive and I was quite concerned about this. – marco-fiset – 2011-11-23T02:26:59.677

Answers

50

hiberfil.sys: is a file used by Windows when you choose to 'Hibernate' the system. Take a look at this site on how to delete it, if you won't use the Hibernate option. In short, you run powercfg -h off in a command terminal with administrator privileges. The file should then be automatically deleted, and the Windows hibernation feature disabled.

pagefile.sys: is the file used by Windows to be your Page File, or your virtual memory swap. If you have 1 GB of RAM and want to use 2 GB as your memory, Windows will create a 1 GB virtual memory in your HD and use it as needed. See this site on how to delete it.

Can you delete them? Yes, but not by simply going to the Windows Explorer and removing them. Take a look at the provided links, or do some research about your Windows version, to know how to delete them.

Notice that simply deleting them is not enough: you'll have to disable the hibernate option and the virtual memory use of your Windows.

woliveirajr

Posted 2011-11-22T18:22:33.887

Reputation: 3 820

the link to ask-leo.com (pagefile.sys) is dead. there's some info here: https://askleo.com/what_is_pagefilesys_and_can_i_move_it/

– AtomHeartFather – 2015-06-27T13:02:53.550

1@user606723 Shame windows haven't figured out how to make that file when in need. Like some dynamic allocation scheme... – Valmond – 2018-11-11T19:19:41.837

6I wouldn't remove the pagefile in Windows 7. In my experience, this leads to strange behavior. However, If you have a exorbitant amount of memory, you may try it. [This is converse from Windows XP where removing the pagefile if you had over 1GB of ram worked perfectly fine] – user606723 – 2011-11-23T07:02:32.357

14

Hiberfil.sys, as the name suggests, is the file to which Windows saves the snap shot data. Thus, the file is always equal in size to the total amount of available RAM on the computer.

To remove the file and disable hibernation.

1.Open a command prompt with administrative privileges.
2.Enter “powercfg.exe -h off”.

Pagefile.sys is the Windows paging file, also known as the file that Windows uses as Virtual Memory. And as such should not be delete.

Unfundednut

Posted 2011-11-22T18:22:33.887

Reputation: 6 650

3

hiberfil.sys is the hibernation file, where Windows writes the contents of your system's memory when it hibernates. I believe that should be safe to delete while your system is running, but I'd like to get confirmation from someone who knows Windows better before you do anything.

pagefile.sys is the, well, pagefile, analogous to the swap partition on Linux (if that helps at all). The system uses it for extra memory when it runs out of space in RAM (it 'pages' it out to this file, thus 'pagefile'). It's extremely (relative to RAM) slow, but usually better than running out of memory altogether. You should NOT delete this file, at least while the system is running.

Edit:-

You can control the existence and size of the pagefile, at least in XP: System Properties->Advanced->Performance/Settings->Advanced/Change.

Kevin

Posted 2011-11-22T18:22:33.887

Reputation: 1 019

1hiberfil.sys can safely be deleted, but this will make hibernation unavailable. Windows does not create the file by itself when used, nor is it deleted afterwards. That wouldn't really help anyway, the free space gained cannot be used, or the OS will not have enough storage for hibernation. – Marcks Thomas – 2012-05-27T10:28:05.553

what happens if i delete the pagefile when the system is not running? In Linux, this would not be a problem. – Janus Troelsen – 2013-04-30T10:31:23.273

1

hiberfil.sys is a file the system creates when the computer goes into hibernation mode. Hibernate mode uses the hiberfil.sys file to store the current state (memory) of the PC on the hard drive and the file is used when Windows is turned back on. In Hibernate mode the PC power is down entirely, so you can even take the battery out, put it back in, and be right back where you were. hiberfil.sys is a hidden file. It means that you could see it in windows file manager only if you checked 'Show hidden files and folders' in Folder Options.

hiberfil.sys is Windows system file and you can’t simply delete it as you would for, say, a file that you yourself created but no longer wanted on your computer. To delete hiberfil.sys in XP: go into Control Panel –> Power Options –> Hibernate tab. Uncheck the box, reboot your PC, and then you can delete the hiberfil.sys file. For Windows 7 or Vista run command line utility as Administrator and type “powercfg -h off”.

http://www.neuber.com/taskmanager/process/hiberfil.sys.html

Mohammad Hussein

Posted 2011-11-22T18:22:33.887

Reputation: 17