The Windows operating system contains several system files required for its proper functioning. Some of 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.
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 10, 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.
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 10/8, 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 over-used 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.
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 which have been ejected from memory and are not expected to be accessed for some time and allow 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 which 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 the 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: