Windows Tweaks Logo Microsoft PC Help - 02 blue red
Windows Tweaks Logo Microsoft PC Help - 09 white 120

Optimize Pagefile.sys safely (resize, move, but better NOT delete)

December 5, 2023
Updated: December 9, 2024
  • Virtual Ram file: Pagefile.sys works as virtual memory and is extremely important for a stable, fast Windows 11/10/7.
  • Optimal setting: Find out how you can delete, enlarge, reduce and move the Pagefile.sys via the "Advanced system settings" (and why we do not recommend deactivating it).
  • Size and data security: Get tips on the right size depending on usage and how to use the Windows registry to automatically delete them every time you shut down to increase data security.

Quick overview:

What is the large Pagefile.sys in Windows?

pagefile sys what is it delete minimize move disable instructions Sandro Villinger expert from Windows Tweaks

Pagefile.sys is something like the hidden hero of Windows 11 / 10 / 7.

This system file, which is often tens of gigabytes in size, is also called a swap file and acts as a virtual working memory: It steps in when the physical working memory (RAM) of your PC reaches its limits.

If you do not have a page file or if it is too small, Windows can become unstable and crash more frequently. Especially if you use many programs at the same time or have memory-intensive applications running.

Windows usually manages the Pagefile.sys automatically and dynamically adjusts its size based on the needs of your system.

Delete, reduce, enlarge, adjust:

Read here how and when you should sometimes change the Pagefile.sys manually to improve your PC performance.

Hidden: Show the Pagefile.sys file in Explorer (instructions)

Where can I find the Pagefile.sys under Windows 11/10/8/7/XP?

Windows stores them in the root directory of your system partition on which the Windows operating system has been installed. Normally this is drive "C:".

But you won't necessarily see it there immediately. This is because this file is hidden by default to prevent accidental changes. 

How to display the file in Explorer:

  1. Open the Windows ExplorerPress the buttons Windows + Eto open the Explorer.
  2. Go to 'This PC': Here you can find your hard disks and drives.
  3. Select 'View' or 'View options'Depending on your Windows version, you will find this in the menu bar or under the "View" tab.
  4. Activate 'Show hidden elements'This makes the Pagefile.sys visible, which is normally located in the root directory of drive C:.
  5. Find & checkNow you can see the file, check its size and other properties.

PS: There you will find two other very large, hidden system files - read our instructions on swapfile.sys and hiberfil.sys and find out what function they have and how you can optimize them.

Deleting and deactivating Pagefile.sys - a risk?

Many users wonder whether they should delete or deactivate Pagefile.sys in order to save memory or improve performance.

We explain why a Deleting the page file is not a good idea is.

And which alternative solutions there are for common problems.

Help, can I delete a huge Pagefile.sys file?

Well, first of all: You cannot simply delete Pagefile.sys.

At least not in Explorer.

It is an important and therefore specially protected system file. 

If you try to delete or remove the page file directly in Explorer, Windows prevents this to ensure system stability.

You can only delete or deactivate Pagefile.sys in a roundabout way (see instructions below) - but this involves risks.

Deactivating it can lead to system instability and crashes, not only if your system is under high memory utilization.

According to Microsoft, the Windows system and many applications continuously use your virtual memory, which means this file.

Deactivate Pagefile.sys (not recommended)

You would like to deactivate your Pagefile.sys despite risks?

For example, temporarily in order to subsequently specify a different, larger or faster drive for the location of the virtual memory?

Then you can do this:

  1. Extended Open system settingsGo to the advanced system settings of Windows.
  2. Customize virtual memoryClick through Advanced > Services > Settings > Advanced > Virtual memory > Change - there you will find the settings for the page file.
  3. DeactivateIn the next window, remove the checkmark next to "Automatically manage file size for all drives". Then select 'No swap file' and confirm your selection.

Remember that this is risky and not recommended.

Data protection: Automatically delete Pagefile.sys on shutdown (instructions)

The automatic deletion of Pagefile.sys at every shutdown can increase security on systems on which sensitive data is processed. 

Sensitive data that was temporarily stored in the virtual memory could remain in the file for a long time. 

Automatic deletion at every shutdown ensures that this data is no longer accessible at the next start.

Instructions for the registry editor (regedit)

  1. Open the registry editorType regedit in the Windows search and open the registry editor.
  2. Navigate to the right keyGo to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management.
  3. Set ClearPagefileAtShutdown: Change the value of 'ClearPagefileAtShutdown' to '1'.
  4. From now on Windows 10 will automatically delete the Pagefile.sys every time it is shut down.

Please note the following effects:

  • System startup can be slowed down: Deleting the file during shutdown can cause the next startup to take a little longer.
  • Caution is advisedChanges to the registry should only be made if you know exactly what you are doing.

Change the size of the Pagefile.sys (reduce and enlarge)

Setting the size of the Pagefile.sys correctly can be crucial to maximize the performance and stability of your PC.

Windows normally sets the size of your file automatically. But there are cases in which a user-defined size can be useful.

When does it make sense to change the size?

Problems with the size of the Pagefile.sys file often occur when the available hard disk space is low. And here the file is huge at the same time.

It often grows to many gigabytes, sometimes 40 GB or more.

Or vice versa: it is too small - which leads to performance problems or even Windows blue screens and crashes.  

And Windows no longer runs smoothly because the physical RAM is used excessively by computing-intensive applications - now an enlarged Pagefile.sys file provides a remedy.

In these scenarios, a manually defined, user-defined size can help.

But be careful: downsizing is usually not advisable. It is better to move the Pagefile.sys to a larger drive instead of shrinking it to avoid performance problems.

Enlarge and reduce Pagefile.sys (instructions)

This way you can reduce and enlarge the Pagefile.sys without unnecessarily burdening your hard disk:

  1. In Windows, go to "Advanced system settings".
  2. Then select the "Advanced" tab and click on "Settings" under "Performance" .
  3. In the "Advanced" tab under Virtual memory, click on "Change" '.
  4. In the next window, uncheck the "Automatically manage file size for all drives" box.
  5. Select the desired size in megabytes (MB). Important: Wear with Initial size and Maximum size always enter identical values (a dynamic size of this file would require more computing power and put more strain on your hard disk).
  6. Restart Windows to apply the changes.

Remember that the correct size of the Pagefile.sys depends on many factors, such as your RAM, your hard disk size and your type of use. 

What is the optimum size?

We recommend that the size of the Pagefile.sys is only not managed by the system in exceptional cases (see above).

If you specify a custom size, the following recommendations will help. 

Recommended size for standard users with 8GB or 16GB RAM 

For everyday Windows use with Office, videos and surfing, it is often sufficient if the Pagefile.sys is around 1.5 to 3 times the size of your RAM. 

Recommended size for power users with 32GB or 64GB RAM

For intensive use such as video editing or Gaming it may be useful to make the Pagefile.sys larger in order to absorb peaks in memory requirements. It is better not to deactivate the pagefile.

For example, anyone who edits 4K videos with Adobe Premiere, can even with 64GB RAM working memory struggle with crashes or a jerky Windows.

The way out:

Set the page file size to 40GB or even 100GB as a test and check whether the performance improves.

Increasing the size could also help with resource-hungry high-end games. Important: Check in advance whether the drive on which the file is located has sufficient free space. 

Recommended size for minimum requirements (with risk)

Setting a Pagefile.sys that is too small carries the risk of system instability. A minimum size due to a lack of space on the hard disk should only be selected if there is sufficient physical RAM and the system load is low. 

Move Pagefile.sys

Moving the Pagefile.sys can be a clever move to optimize the performance of your PC.

However, please note the following 3 points before changing or moving the file:

  • Backup copy: Before you make any changes to the system settings, it is advisable to create a backup of your most important data.
  • Check storage spaceMake sure that the target drive has enough free space.
  • System monitoringObserve your system after moving the Pagefile.sys to make sure that everything works smoothly.

With these instructions you can move the Pagefile.sys - safely and effectively. This will not only improve the performance of your PC, but also make optimum use of your memory resources.

How to move the Pagefile.sys safely (instructions)

  1. Open system settingsFirst open the advanced system settings. You can do this, for example, by right-clicking on 'This PC', selecting 'Properties' and then 'Advanced system settings' at the bottom of the window.
  2. Adjust performance settingsIn the new window, click on the 'Advanced' tab and then on 'Settings' under 'Performance'.
  3. Manage virtual storageIn the performance options, select the 'Advanced' tab again and click on 'Change' under 'Virtual memory'.
  4. Deactivate automatic management: Remove the checkmark next to 'Automatically manage the size of the swap file for all drives' if the file is managed by the system.
  5. Deactivate page file in current driveSelect "No swap file" and click "Set", confirm the warning message with "Yes".
  6. Selecting the new driveNow select the drive to which you want to move the Pagefile.sys.
  7. Set sizeEnter the initial size and the maximum size of the Pagefile.sys for the new drive. It is recommended to set these values to at least 1.5 to 3 times your RAM. IMPORTANT: Are you a power user with CPU-intensive applications (video editing or gaming)? Then check the size of your current Pagefile.sys in advance. It may be 20 GB, in extreme cases even 100 GB, because the system requires more virtual RAM than a standard Windows user. In this case, it is better not to set the size smaller, as this could lead to performance problems or crashes (even if 32GB or 64GB RAM physical memory is installed)!
  8. Confirm changesClick on 'Set' and then on 'OK' to save your changes.
  9. System restartAfter you have made these changes, you will need to restart your PC for the Pagefile.sys move to take effect.

When does it make sense to postpone?

Moving the Pagefile.sys is particularly useful if you realize that your current configuration is not optimal - be it because of slower access times on an HDD or because of a lack of space on one of your Windows system partitions (usually "C") or an SSD that is too small.

Examples:

  • Performance improvementOn a system with a slow HDD, moving the Pagefile.sys to an SSD can noticeably improve the overall response time of the system.
  • Storage space managementIf you have little space on your SSD, moving the virtual memory to a larger HDD can help to keep the valuable SSD memory free for other applications.

SSD or HDD - where to move?

If you have an SSD, it's a good idea to move the Pagefile.sys to it. SSDs are faster than HDDs, which means that your Windows system can access the data on them faster. 

This can make a noticeable difference, especially under load.

Frequent write operations can theoretically affect the service life of an SSD. And this file is often written to. However, modern SSDs are usually robust enough to cope with this without significant effects.

The only important thing is to always set the same values for the initial size and maximum size of the file. Dynamic enlargement and reduction results in unnecessary load and increased SSD wear.

However:

Did you only a small SSD with little free storage spacebut still have a larger HDD? Then it may make sense to move Pagefile.sys to the HDD to save valuable SSD storage space.

And above all, to avoid having to set the size of the page file too small - because this could cause performance problems and, in the worst case, Windows crashes.

Therefore, always make sure that the target drive - whether SSD or HDD - has enough free space to accommodate a sufficiently sized Pagefile.sys.

Virtual RAM: How the page file ensures smooth working & prevents system crashes

The Pagefile.sys acts as an extension of your physical RAM: 

Imagine you are working on many applications at the same time in Windows 11, 10 or 7 and your RAM is almost full. Windows then uses Pagefile.sys, which provides additional memory.

You can continue working without your PC slowing down or crashing.

This is because Windows swaps data from RAM to this file - which is why it is also called a swap file.

Without this system file, your operating system or individual apps would crash or slow down. Especially with many parallel or computing-intensive processes.

The Windows system management automatically controls the page file and dynamically adjusts its size depending on your system load.

Normally, you don't have to worry about it taking up too much storage space or not being used efficiently enough.

But in some cases it can help if you manually change, optimize and adapt the Pagefile.sys to your custom needs as described in the instructions above.

Summary

In this article, we have taken an in-depth look at the Pagefile.sys file in Windows. Our mission was not only to show you what this file does, but also how you can use it to your advantage. 

Here are the most important points we have covered:

  • Virtual RAMWe have explained that the Pagefile.sys acts as virtual memory and is essential for system stability and performance. It helps to keep your PC running smoothly even under high load.
  • Size adjustmentYou have learned how to reduce and increase the size of the Pagefile.sys in order to adapt it to your specific needs. Properly sized, it can significantly improve performance.
  • Delete and deactivateWe have made it clear that deleting or disabling the Pagefile.sys is not recommended in most cases, as this can affect system stability. Instead, we have shown alternative solutions, such as automatic deletion on shutdown for increased security.
  • Moving the fileWe have shown how you can move the Pagefile.sys to another drive to save disk space on your main drive or to increase system performance.

FAQ

References

Founded WindowsTweaks as a teenager in the 90s. His helpful PC tricks made it Germany's most visited Windows site (at the time Sandro looked like this). He then went on to write elsewhere, for example for PC-Praxis, Computer Bild and PCWorld in the USA. Microsoft also poached him from us. Now Sandro is back, finally sharing his tweaks here again. For a stress-free digital everyday life. You can reach Sandro via e-mail.

Leave a Reply

Your email address will not be published. Required fields are marked *

Windows Tweaks Logo Microsoft PC Help - 09 white 120
by Real Tech Experts
Save time and nerves with expert knowledge about software, hardware, AI & Microsoft. 
Windows Tweaks Microsoft PC Help - SINCE 1998 - retina 2

Time-saving tips for PCs, laptops, Windows and software?

Subscribe to our newsletter, receive only our best tutorials & tweaks and exclusive tips for our subscribers. 
Newsletter form
Can be canceled at any time. About 1 - 2 mails per month. The consent includes the information on revocation, shipping service provider and statistics according to our Privacy policy.
© 1998 - 2025 Windows-Tweaks.info
Made in Germany with ❤️ 
For all technology users around the globe.
This website runs on 🌳 GREEN energy
crossmenu