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

The Pagefile.sys is something like the hidden heroine 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 don't have a page file or 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 reliably automatically and adjusts its size dynamically 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 anyway?

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 Windows Explorer: Press the Windows + E keys to open Explorer.
  2. Go to 'This PC': Here you will find your hard disks and drives.
  3. Select 'View' or 'View options': Depending on your version of Windows, 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 & check: Now you can see the file, check its size and other properties.

PS: You will find two other very large, hidden system files there - 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 to save memory or improve performance.

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

And what 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 there are risks involved.

Disabling can lead to system instability and crashes, not only if your system is under high memory usage.

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

Deactivate Pagefile.sys (not recommended)

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 it like this:

  1. Open advanced system settings: Go to the Windows advanced system settings.
  2. Customize virtual memory: Click through Advanced > Performance > Settings > Advanced > Virtual memory > Change - there you will find the settings for the page file.
  3. Disable: In 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 virtual memory could remain in the file for a long time.

The automatic deletion at each shutdown ensures that this data is no longer accessible at the next startup.

Instructions for the registry editor (regedit)

  1. Open registry editor: Type regedit into the Windows search and open the registry editor.
  2. Navigate to the correct key: Go 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 Pagefile.sys every time it is shut down.

Please note the following effects:

  • System startup can be slowed down: Deleting the file on shutdown can cause the next startup to take a little longer.
  • Caution is advised: Changes should only be made to the registry 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 where 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 small. And at the same time the file is huge.

Not infrequently it grows to many gigabytes, sometimes even 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 overused 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: reducing the size is usually not a good idea. It is better to move Pagefile.sys to a larger drive instead of shrinking it to avoid performance problems.

Enlarge and reduce Pagefile.sys (instructions)

How to reduce and enlarge Pagefile.sys without unnecessarily burdening your hard disk:

  1. Go to "Advanced system settings" in Windows.
  2. Then select the "Advanced" tab and click on "Settings" under "Performance".
  3. Click on "Change" in the "Advanced" tab under Virtual memory '.
  4. In the next window, remove the checkmark next to "Automatically manage file size for all drives".
  5. Select the desired size in megabytes (MB). Important: Always enter identical values for Initial size and Maximum size (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 not having the system manage the size of the Pagefile.sys only in exceptional cases (see above).

If you set 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

When used intensively, such as for video editing or gaming, it can 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, if you edit 4K videos with Adobe Premiere, you may struggle with crashes or a jerky Windows even with 64GB RAM.

The way out:

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

Scaling up could also help with resource-hungry high-end games. Important: Check in advance whether the drive on which the file is located has enough free disk 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 hard disk space 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 space: Make sure that the target drive has enough free space.
  • System monitoring: Observe your system after moving the Pagefile.sys to ensure that everything is running 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 settings: First 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 settings: In the new window, click on the 'Advanced' tab and then on 'Settings' under 'Performance'.
  3. Manage virtual memory: In the performance options, select the 'Advanced' tab again and click on 'Change' under 'Virtual memory'.
  4. Disable 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. Disable page file in current drive: Select "No swap file" and click "Set", confirm the warning message with "Yes".
  6. Select the new drive: Now select the drive to which you want to move the Pagefile.sys.
  7. .
  8. Set size: Enter 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. Then 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)!
  9. Confirm changes: Click on 'Set' and then on 'OK' to save your changes.
  10. System restart: After 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 notice 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 improvement: On a system with a slow HDD, moving Pagefile.sys to an SSD can noticeably improve the overall response time of the system.
  • Space management: If you are short of space on your SSD, moving the virtual memory to a larger HDD can help to free up valuable SSD memory 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 impact.

The only important thing is: 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:

Do you only have a small SSD with little free space, but 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.

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 memory 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 user-defined 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 RAM: We have explained that the Pagefile.sys acts as virtual RAM and is essential for system stability and performance. It helps to keep your PC running smoothly even under heavy load.
  • Sizing: You have learned how to reduce and increase the size of Pagefile.sys to suit your specific needs. Sized correctly, it can significantly improve performance.
  • Deleting and deactivating: We have made it clear that deleting or deactivating Pagefile.sys is not recommended in most cases, as this can affect system stability. Instead, we have highlighted alternative solutions, such as automatic deletion on shutdown for increased security.
  • Moving the file: We 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 Windows Tweaks 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