Hiberfil.sys, Pagefile.sys & the New Swapfile.sys file in Windows 8

The Windows operating system contains several system files required for its proper functioning. Some among them which raise a lot of curiosity are Swapfile.sys, Hiberfil.sys & Pagefile.sys. To see these system files on your System (C) Drive root you will have to un-hide protected operating system files from Folder Options. In this post we will briefly talk about each file.

sys files 600x86 Hiberfil.sys, Pagefile.sys & the New Swapfile.sys file in Windows 8

Hiberfil.sys

Hiberfil.sys file is a system file that is used by Windows to support Hibernation. If you have enabled Hibernation in Windows 8, you will see this file.

Read: Disable, Enable Hibernate in Windows 8.

When you have Hibernation, and subsequently Fast Startup enabled (which is the default setting), your Hiberfil.sys file will be approximately 3/4th of your RAM. So you can see that the Hiberfil.sys file in my case is 6.6GB, since I have a RAM of 8GB. In case you have disabled Hibernation, you will find its size roughly equalling your RAM.

In Windows 8, you will not find the size of Hyberfil.sys running wild, when you have Hibernation enabled. In the earlier version of Windows, the hibernation file stored the kernel session, device drivers and application data. In Windows 8, the hibernation files stores the kernel session and device drivers only, as a result of which the size remains more or less constant.

Disable Hibernation

If you wish to, you can always disable/enable hibernation manually or by using our Ultimate Windows Tweaker,  or a Microsoft Fix It. But then remember, that in Windows 8, this will disable Fast Startup too.

Pagefile.sys

Pagefile.sys or the Page File is the computers paging file which your Windows uses as Virtual memory. The PageFile.sys holds objects in an over-used memory that have not been accessed for a long period of time. When Windows runs out of physical memory, it resorts to using the Page File, by writing some of the contents of RAM on to the disk. If this ‘Paged out’ memory is needed back, some other part is written to disk and this part is read back. You can read more on Paging Files at TechNet.

If you often get a message Your system is low on virtual memory, when you try to start any memory intensive application, you may want to increase the  Paging File size. The size of the Page file on my Windows 8 PC is around 1.2GB.

Delete Pagefile.sys

Cleaning the Page file on every shutdown means overwriting the data by zeros, and it takes time. This will increase shutdown time. But if you work on confidential documents, then you may want to have this setting ‘on’. When you load such documents, they are loaded into RAM. To save RAM Windows places certain items in the pagefile. Hence you may want to delete pagefile at every shutdown, in such cases. To do so open Regedit and navigate to the following key:

HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\ Session Manager\ Memory Management

In the right pane, select New > DWORD (32-bit) Value. Name the DWORD value ClearPageFileAtShutdown and give it value of 1.

Swapfile.sys

In earlier versions of Windows, you had Swapfile.sys or the Swap file. The Swap file holds objects which have been ejected from memory and are not expected to be accessed for some time and allows an operating system to use hard disk space to simulate extra memory whenever the system runs low on memory, by swapping section of RAM that an idle program is using onto the hard disk to free up memory for other programs. This combination of RAM and Swap files is known as Virtual Memory. Having a swap file makes your computer’s operating system “have” more RAM than it actually has.

The Swapfile is not used in the fast startup process of Windows 8. It is the Hiberfil.sys file which stores the kernel session and comes into play here.

In Windows 8, you again get to see Swapfile.sys! This latest version of Windows has both – the swapping as well as the paging file at the same time. It is around 256 MB in size – in my case it is 262 MB.

Why do we need another virtual page file in Windows 8 ?

The Swapfile.sys in Windows 8 is a special type of pagefile used internally by the system to make certain types of paging operations more efficient. It is used to Suspend or Resume Metro or Modern Windows 8 apps.

TechNet explains the ‘new’ Swapfile.sys in Windows 8 as follows:

With the introduction of the Modern App, we needed a way to manage their memory outside of the traditional Virtual Memory/Pagefile method. With that, the “%SystemDrive%\swapfile.sys” was born.

Windows 8 can efficiently write the whole (private) working set of a suspended Modern app to disk in order to gain additional memory when the system detects pressure.  This process is analogous to hibernating a specific app, and then resuming it when the user switches back to the app.  In this case, Windows 8 takes advantage of the suspend/resume mechanism of Modern apps to empty or re-populate an app’s working set.

I hope this explains the reason why we see all the 3 files viz. Hiberfil.sys, Pagefile.sys & Swapfile.sys files in Windows 8.

Looking to learn more about other files or file types or file formats in Windows? Check these links:

Windows.edb files | Thumbs.db files | DLL and OCX files Index.dat file |NFO and DIZ files | Nvxdsync.exe.

Posted by on , in Category Windows with Tags
Anand Khanse aka HappyAndyK is an end-user Windows enthusiast, a Microsoft MVP in Windows, since 2006, and the Admin of TheWindowsClub.com. Please create a System Restore Point before trying out any software & be careful about any third-party offers while installing freeware. Add me on Google+.
  • Jay Stephens

    Wow, so to handle the “new” Metro/Modern apps it’s back to the future using a very old Windows file name and yet another file writing over and over to my SSD drive wearing it out before it’s time. I have moved my page file off my SSD, but there is no way to do that with swapfile.sys, great move (NOT) MS.

  • http://twitter.com/just_for_phun Pitch

    Is it possible to move the hiberfil, pagefile and swapfile to a different partition? My Windows 8 partition is very quickly running out of space, and I’d like to get some back. I have a separate partition with plenty, but I’m not sure if Windows will let me move it without freaking out. Can I patch it through with symlinks, or would that break something?

  • James M

    I have 32gigs ram so hiberfil is almost 27gig and a 5 gig page file on a ssd drive at that, how does that even make sense? i can see matching low amounts of ram, but 27gig hiberfil? really?

  • Kaziform .

    An SSD does not “wear out”. Also, the best place and the best performance for a paging file is on your SSD. Great move (NOT), Jay Stephens.

  • uhohspagettios

    Are you kidding me? Of course SSDs wear out. Each cell has a finite number of reads/writes, and swapping wears down on this substantially.

  • Jow Caruso

    you can set your hibernation file size smaller, search on google for that, its a very simple command ;)

  • Christopher Gibson

    Yeah that hiberfil.sys file is ridiculous. It is a massive waste of space and the size it can grow is unreal. I believe it’s 3/4 the size of your ram and really only needed if you want to save some life of a laptop battery and a quicker bootup. It has screwed me right in the middle of downloading battlefield 4 dlc 34 gig download. I never have hibernation,sleep,turn off display,turn off hard drives,etc enabled. Also with these rumours of wearing out your solid state drives. Each sector in an SSD averages 100’s of terabyte read n writes in it’s life expectancy.
    Open your command prompt and type…….powercfg.exe -h off…….and hit enter. Your massive hiberfil will be gone and you’ll save some more space for your needs. It is totally retarded that a file with that size is even designed by windows and created and left on your drive when hibernation is not used. I had a 100 gig ssd that I was using just for windows and speed. All games n programs except one were installed on the slave disk drive. I had a hiberfil with exact same size as yours and it screwed a day long download from EA right at the end it said disk full. I used the above command and redownloaded and tower is flyin. Kill that stupid file.

  • Recent Comments