- Pagefile.sys acts as virtual memory en Windows when RAM runs out
- Deleting it may save space, but it can also cause errors or crashes.
- It is possible to adjust its size or move it to another drive without deleting it.
- It can be set to be automatically deleted when the PC is turned off.
If you are a Windows user and have ever browsed the depths of your hard drive, you have probably come across a file called pagefile.sysThis file often goes unnoticed, but when it starts taking up several gigabytes of space for no apparent reason, it's only natural that it sparks curiosity... and concern.
In this article we will explain What exactly is pagefile.sys, what is it for? and whether or not it is advisable to delete or modify it. We will also go into depth on how you can adjust its size or move it to another drive to optimize your system performance or gain some free disk space. All with step-by-step explanations so you can make informed decisions without jeopardizing your computer's stability.
What is pagefile.sys and why does it exist?
The file pagefile.sys It is a fundamental part of the Windows operating system. Its main function is to act as a RAM memory extension computer physics through a type of storage called virtual memory.
When we open many applications or work with programs that consume large amounts of memory, we may find that we don't have enough RAM. This is where pagefile.sys comes into play: to prevent the system from running out of resources, Windows temporarily moves some data from RAM to this file, located by default on the C drive.
This process is completely automatic and transparent to the user. The file acts as a safety cushion which allows you to keep more applications open at the same time or prevent the system from crashing when physical memory runs out.
Additionally, even if you have plenty of memory installed, Windows will still use pagefile.sys for certain system operations. Therefore, even with 16 or 32 GB of RAM, you may find this file taking up disk space.
Where is it located? It is usually housed in the root of the drive C And since it's a protected operating system file, it won't appear in File Explorer unless you enable the display of hidden files and uncheck the option to hide protected operating system files.
Do I really need it if I have a lot of RAM?
The need for the pagefile.sys file depends largely on the amount of RAM installed on your computer and how you use it. For example:
- With less than 8 GB of RAM: It is highly recommended to keep it. If you delete pagefile.sys, your computer may experience slowdowns, crashes or forced shutdowns when you run out of physical memory.
- With 16 GB or more: You can consider disabling it, although in general terms it is not advisable, especially if you use demanding programs or work with multiple applications open at the same time. In addition, some system processes and specific applications require virtual memory to function properly.
So, while you can live without pagefile.sys, it makes the most sense in most cases to keep it enabled, or reduce its size if disk space is a concern.
Advantages and disadvantages of deleting pagefile.sys
Deleting the file may help you recover several gigabytes of disk space, but it is not without risks. Some of the expected benefits to delete pagefile.sys are:
- Recover from 1 to more than 10 GB depending on their size.
- Avoid continuous writing to disk, which can extend the useful life of a SSD.
- Force the system to work only with RAM, which may slightly improve performance if RAM is plentiful.
But there are also major drawbacks:
- Risks of system crashes or errors if RAM runs out.
- Incompatibilities with programs that require a paging file to run.
- The function of memory dump to diagnose system errors depends on pagefile.sys.
If you still decide to remove it, it would be best to test it for a few days and verify that the system behaves normally.
How to remove pagefile.sys step by step
Deleting pagefile.sys isn't like deleting any other file. Windows won't let you delete it directly from File Explorer because it's constantly in use. To properly disable it, follow these steps:
- Press Win + WILL and look for «sysdm.cpl» to open the system properties.
- In the «Advanced«, Click the« buttonConfiguration» within the section «Unlimited«.
- In the new window, select the tab «Advanced» and press «Change" in "Virtual memory«.
- Uncheck «Manage automatically the size of the paging file for all drives.
- Brand "No paging file«, click on «Establish»And then«Accept«.
- Restart your computer to apply the changes. When you restart, pagefile.sys will be deleted.
What if I prefer to keep it but reduce its size?
Instead of eliminating it, another more balanced option is assign a custom sizeThis method can help you save space without compromising system stability.
To do this, follow the same path described above, but instead of selecting “No paging file”, choose “Custom size” and defines an initial and maximum size in megabytes (MB).
- Example with 8 GB of RAM: You can set 2048 MB as minimum and 4096 MB as maximum.
- With 16GB or more, a size between 1 and 2GB is sufficient to maintain basic functions.
Remember to restart your computer for the new values to take effect.
Is it possible to move pagefile.sys to another drive?
Yes. If your C drive is full or you simply prefer that this file not consume resources from your primary SSD, you can move it to another drive. secondary disk driveThis option is especially useful if you have an additional hard drive with more capacity.
To do it:
- Come back at Virtual Memory options from «sysdm.cpl».
- Select C drive, check “No paging file» and press “Establish".
- Select the new drive (e.g. D:), check “System managed size» or «Custom Size» and press “Establish".
- Click “OK” and reboot your system.
Importantly Windows recommends keeping the file on the same drive where the operating system is installed., since in case of critical errors, the system needs to have this file accessible to dump useful information for diagnosis.
Delete pagefile.sys automatically when you shut down your PC
Another alternative without permanently disabling the file is to configure your system so that I deleted it every time I shut downThis frees up space every time you shut down your PC, although it will be created again when you turn it back on.
To do this you can do it in two ways: through the Group Policy Editor or Registry Editor.
Using the Group Policy Editor:
- Press Win + R, writes gpedit.msc and hit Enter.
- Navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options.
- Find and double-click on «Off: Clear the virtual memory paging file«.
- Activate the option «Able»And confirm.
From the Registry Editor:
- Press Win + R, writes regedit and hit Enter.
- Go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
. - double click on ClearPageFileAtShutdown and change its value to 1.
- Close the editor and restart to apply changes.
What about hiberfil.sys? Should I delete it too?
The file hiberfil.sys It is related to the function of Windows hibernation, which allows you to save the current state of the RAM to the hard drive so you can shut down your computer completely and resume later right where you left off.
This file can also take up several GB, and if you never use hibernation, you can safely delete it. To do this, open a symbol of the system as administrator and writes:
powercfg -h off
This command disables hibernation, and when you do so, the hiberfil.sys file disappears.
Additional Tips to Free Up Space
If the reason you are considering deleting pagefile.sys is gain disk space, there are other actions you can try first:
- Clear Temporary files and old updates with the disk cleaning tool.
- Uninstall software you don't use.
- Delete games or apps that you can reinstall in the future.
- Transfer media files (photos, music, videos) to an external drive or the cloud.
- Empty the recycle bin and clean it downloads ancient.
Both pagefile.sys and hiberfil.sys are system files that perform necessary functions to maintain Windows stability. You can do without them or modify their behavior, but always do so with due care and attention to the results.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.