When your system runs out of physical memory, or total available RAM, it cannot perform new tasks unless you free up the memory. This is where the concept of paging and virtual memory comes into play.
Virtual memory acts as an extension of RAM if it runs out of memory. The system uses storage space from the storage device, which acts as a temporary storage for pages of memory from RAM. This process is called paging, and the pages of the virtual address are stored in a file called a Pagefile.
Now let’s further discuss pagefile.sys
file and how it works.
Understanding Pagefile.sys
Pagefile.sys
is a hidden file located on your C drive that reserves a certain amount of storage.
When the system runs out of physical memory, it transfers the least used pages of memory from RAM to pagefile.sys
file on your local storage. By doing so, the system frees up physical memory and performs extra tasks without running out of memory.
If the CPU requires data saved in pagefile.sys
, the system loads this data back to RAM for processing. However, this takes longer compared to fetching data directly from RAM. So, the performance will decrease when the system uses virtual memory compared to the actual physical memory.
Furthermore, if the system is constantly accessing the page file, you will see the disk usage spike up, and the disk LED will start to flicker. If you are not performing anything on the disk but the disk usage is constantly high, it’s an indication that you might need to upgrade your RAM
Do I Need pagefile.sys?
A system with 8GB or lower RAM may be enough for casual usage but might not be enough for photo/video editing or light gaming sessions. If your system constantly freezes due to the high RAM usage, you might require a page file to increase your system performance.
On the other hand, systems with 16 GB or higher RAM may not face low memory problems compared to systems with lower RAM. So disabling pagefile.sys
(or virtual memory) will not be much of an issue as long as the system does not reach the memory limit.
However, if you want to be on the safe side, you can let the OS manage the paging file size for all drives. The size of the pagefile.sys
entirely depends on the virtual memory settings.
Furthermore, pagefile.sys
also contains Memory.dmp or crash dump file, which you can use to diagnose the error if the system crashes. The system cannot create the dump file if you disable pagefile.sys
.
Ideal Pagefile Size
Depending on your system’s storage and physical memory, the minimum value should be 1.5 times the memory of installed RAM, and the maximum value should be 4 times the RAM memory. We recommend that you try different values within this limit.
Here are a few things that you need to consider when setting a pagefile size.
- Commit Limit: Commit limit is the total memory (physical and virtual) available. If the system has low RAM capacity, we recommend increasing the commit limit by increasing the page file size.
- Memory Dumps: Crash dump requires a page file of the size that’s equal to physical memory + 1MB. Similarly, kernel dumps require about one-third size of installed physical memory.
Set Custom Pagefile Size
The size of your pagefile.sys
completely depends on the virtual memory settings and total physical memory available in your system.
If your pagefile.sys
is taking up a lot of storage, you can change virtual memory properties to decrease the amount of virtual memory.
- Press Windows + R key.
- Type
sysdm.cpl
to open System Properties. - Go to the Advanced tab.
- Click on Settings under Performance.
- Click on the Advanced tab. Here, you can see the total pagefile size or allocated virtual memory.
- Click on Change to set a custom page file size.
- Select a drive in which you want to manage the page file.
- Check the Custom size option. Here, you can set the maximum and minimum size for
pagefile.sys
.
Can I Delete Pagefile?
You cannot delete pagefile.sys
file as it is a system file, and when attempting to delete it, you will get a dialog box that says File in Use.
However, you can disable virtual memory. By doing this, the OS automatically releases the reserved storage and removes the pagefile.sys
file from the C drive.
- Open System Properties.
- Go to the Advanced Tab.
- Under Performance, click on Settings.
- Again in the Advanced tab click on Change under Virtual memory.
- Uncheck Automatically manage paging file size for all drives.
- Check the No paging file and click on Set.
- Click on Yes if it asks for confirmation.
- Click on OK.
- Restart your PC to apply changes.
- Now, open the C drive to check if the
pagefile.sys
file exists.
We do not recommend removing pagefile.sys
on a system with low physical memory. It may result in system instability and performance issues.
If you do not want to delete it, you can move it to another drive to free up space from the root drive. To move pagefile.sys
to another drive.
- Open System Properties and go to the Advanced tab.
- Click on Setting under Performance.
- Click on Advanced tab and select Change.
- Uncheck Automatically manage paging file size for all drives.
- Click on C drive.
- Check No Paging file and click on Set.
- Now, click on the volume in which you want to set
pagefile.sys
. - Check System managed size and click on Set.
- Click OK and then Apply.
- Restart your PC.