The Windows 11/10 operating system contains several system files required for its proper functioning. Some of them that raise a lot of curiosity is 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.
What is Hiberfil.sys file
Hiberfil.sys file is a system file that is used by Windows to support Hibernation. If you have enabled Hibernation in Windows, you will see this file.
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 in Windows 7.
In Windows 11/10 now, it is 40%. In case you have disabled Hibernation, you will find its size roughly equalling your RAM. In Windows 11/10/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 11/10, the hibernation file stores the kernel session and device drivers only, as a result of which the size remains more or less constant.
Hibernation files are used for hybrid sleep, fast startup, and standard hibernation. There are two types, differentiated by size, a full and reduced-size hibernation file.
Hibernation file type | Default size | Supports… |
---|---|---|
Full | 40% of physical memory | hibernate, hybrid sleep, fast startup |
Reduced | 20% of physical memory | fast startup |
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 11/10 this will disable Fast Startup too. If you feel the need to, you can change the size of hiberfil.sys file.
What is Pagefile.sys file
Pagefile.sys or the Page File is the computer paging file that your Windows uses as Virtual memory. PageFile.sys holds objects in an overused memory that has 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.
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.
Where is Pagefile.sys stored?
Pagefile.sys called as Swap file, Page file, or Paging file is located at C: drive by default. It is a hidden file and you will have to make Explorer to Show protected operating system files.
Read: How to Back up or Move PageFile.sys.
Delete Pagefile.sys
Clearing the Page file on every shutdown means overwriting the data by zeros, and it takes time. This will increase the 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 on 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 a value of 1.
Read: What is the best Page File size for 64-bit versions of Windows?
What is Swapfile.sys file
In earlier versions of Windows, you had Swapfile.sys or the Swap file. The Swap file holds objects that 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 11/10. It is the Hiberfil.sys file that stores the kernel session and comes into play here.
In Windows 11/10, 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.
Read: How to reset Virtual Memory or Page File in Windows
Why do we need another virtual page file in Windows 11/10?
The Swapfile.sys in Windows 11/10 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 UWP Windows apps.
TechNet explains the ‘new’ Swapfile.sys in Windows as follows:
With the introduction of the UWP 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 can efficiently write the whole (private) working set of a suspended UWP 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 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 three files, viz. Hiberfil.sys, Pagefile.sys & Swapfile.sys files in Windows 11/10.
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 | Desktop.ini file | Nvxdsync.exe.
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.
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?
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?
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.
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.
you can set your hibernation file size smaller, search on google for that, its a very simple command ;)
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.
You can use MKLINK command to move the swapfile.sys and pretty much and file/directory to an alternative drive if need be. I use this for apps that don’t allow for a custom drive installation, once installed, move the directory across to the drive and MKLINK where the directory used to be.
SSDs DO wear out! In fact, single cell endurance has gotten WORSE over the past decade as SSD technology has advanced! This is because we have smarter SSDs that distribute write cycles over the entirety of the device. HOWEVER, as your SSD nears capacity, things like PageFile, HyberFile, and SwapFile tend to sit on the same (it will be the set of cells in unused space) cells (NAND/ MLC/ or whatever tech), quickly deterioating the state of the SSD, and taking it ever closer to it’s end of life. This can be offset some by SSDs that move information around to account for this, but this still puts a lot of stress on your SSD. Microsoft really needs to have options for individuals who have extremely high end machines with ample RAM such that the system will not use Page files or Swap files by default. My computer has 64GB of RAM, I don’t need a Page File or Swap File in most cases, so why is Windows using them?
Why is it that after 20 years we still see statements like this:
“Pagefile.sys or the Page File is the computers paging file which your Windows uses as Virtual memory.”
The paging file is not virtual memory. This falsehood made its way into Windows (95?) as a callout in one of the advanced system properties panels. And it has been perpetuated in lore ever since.
But it is just as false today as it was then. The paging file is not virtual memory! It is just … the paging file.
What? DISabling hibernation results in a Hiberfil.sys file 33% LARGER
than ENabling it? Are you sure about that? That doesn’t make any sense
to me.
Please explain more.
What do *you* mean by Virtual Memory?
Of course SSDs wear out.
But you can leave those files on your SSD as long as you have enough RAM so that swapping is a rare occurrance.
^^^I did this, and it’s awesome when it works. But Windows Updates can FUBAR your system, so I don’t use it any more.
You are clueless dude.
Damn with that much ram why not use a startup util that moves your page file to a ram disk. :)
umm.. just delete the file once hibernation is disabled.