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

Swap file in Windows 10 & Windows 11: How to use it to optimize PC performance (increase, adjust, deactivate swap)?

December 1, 2023
Updated: April 12, 2025
  • Crashes & freezes: The swap file works as virtual RAM in Windows 10 / 11 and can cause problems with your PC performance.
  • Adjust & set size: Get simple instructions on how to increase and set your swap file in the Advanced system settings if the automatic management by Windows 11 or Windows 10 is not sufficient, for example for gaming and video editing.
  • Risky deactivation & downsizing: Prevent a swap file that is too small or deactivated from slowing down or crashing your PC.
  • SSD tips: Benefit from fast SSDs and avoid unnecessary hard disk fragmentation.

Quick overview:

What is the swap file in Windows 10 & Windows 11?

No stuttering, everything runs smoothly despite many computing-intensive applications: Windows 10 and Windows 11 use the swap file to improve your PC performance - and prevent crashes caused by an overloaded RAM.

Set swap file in Windows 10 11 7 8 XP delete resize move disable instructions by Sandro Villinger expert of Windows Tweaks

This hidden system file is the "smart" system of the virtual working memory:

If the physical RAM is running low or should simply be relieved, the system management of Windows 11 and 10 automatically decides which files and programs are swapped out to the paging file (pagefile.sys).

This can be caused, for example, by many complex applications or games being opened at the same time.

But not only when your RAM is full and the system is about to crash, even if your RAM is not being used to capacity, the swap file in Windows 11 and 10 will jump in and save excess data. Always ensuring stable, smooth computing performance.

It is the invisible performance heroine of Windows.

It works in the background to ensure that everything runs smoothly and without delays.

How and when should you change the swap file in Windows 11 and 10?

And why do we advise you, unlike with earlier Windows versions, not to set a user-defined size prematurely under Win 11 and Win 10?

Increase and optimize the swap file in Windows 10 / 11

Let's start right away with manually setting the swap file:

Changing, moving and enlarging the swap file in Windows 10 and 11 can be done quickly and easily via the advanced system settings.

Risky tips in online guides and ChatGPT / AI chatbots

Many Internet guides give hair-raising recommendations for the swap file. Even ChatGPT 4 advised me in tests to make risky changes, which would lead to crashes in Windows 11 / 10, especially for power users in areas such as gaming and video editing. See example of an Adobe Premiere user below.

Please read our recommendations and the effects of manual configuration and sizing in advance.

4-step guide to changing the swap file (size and drive)

Here is a quick guide:

  1. Open the Advanced system settings in Windows 11 or 10.
  2. Click on the Advanced tab and then under Performance on Settings.
  3. Go to Advanced again and click Change under Virtual memory.
  4. In the next window, uncheck Manage file size for all drives automatically.

Now you can set a user-defined size of the swap file and customize its location or drive according to your needs.

Here are all the steps to the settings as a picture gallery:

When should I increase the size and manually change the swap file in Windows 11 / 10?

Are you thinking about increasing the size of the Windows 11 / 10 swap file or setting it manually?

This is possible, but you should know:

In the meantime, Microsoft's operating system manages the virtual memory reliably and automatically.

Since earlier versions, a lot has changed: The virtual ram calculation runs much more intelligently under Win 10 than it did under XP. With Windows 11, there was another leap forward.

As a Windows expert, I recommend today (as do other specialists and MVPs) that most users use the automatic handling by the system and do not "play around" with it.

Now comes the big "but"...

Sometimes a manual adjustment of the size and moving may still be necessary:

  • Optimize storage space: If the Windows installation drive (C:) is too small, move the swap file to a drive with more storage space (select the storage location in the above settings, see images). Otherwise, the file size could cause the system partition or hard disk to "fill up" and lead to system crashes.
  • Increased memory requirements: With high memory usage (such as 4K video editing and 3D games), it may make sense to increase the file size to >100GB or set up an additional swap file on another drive.
  • Acute lack of disk space: If the swap file is too large and the disk space on your system partition is low, you could theoretically set a smaller, user-defined size (Caution: In practice, this can lead to sudden crashes later with memory-intensive applications! Our recommendation: If possible, move them to a larger drive as mentioned above or let Windows 11 / 10 continue to manage them).
  • Error correction: If the error "BSOD PAGE_FAULT_IN_NONPAGED_AREA", "KERNEL_DATA_INPAGE_ERROR" or a memory shortage occurs, it may be necessary to enlarge the swap file. Or a user-defined size is set that is too small - and switching to automatic file size provides a remedy.

But what swap file size is sufficient and recommended?

Recommended size of the swap file for 8GB, 16GB, 32GB and 64GB RAM

Do you want to have the swap file size not managed by Windows 11 or Windows 10, but instead set a user-defined size?

Swap file in Windows 10 and Windows 11 initial size and maximum size Sandro Villinger Windows Tweaks Expert 01

Here are a few rules of thumb:

  1. Initial size and maximum size: Always set identical values, see image above. Different sizes are not good, as the dynamic enlargement or reduction of the swap file requires more computing time and places an unnecessary load on the hard disk. That is why I have always recommended entering the same values in megabytes in both fields (nothing has changed since Win XP ;).
  2. For less than 8 GB RAM memory: Set the swap file to at least 1.5 - 3 times your RAM. With 6GB RAM, this means 9,000 megabytes or more (the more performance-hungry your processes, the more MB are required). As mentioned, the initial size and the maximum size should be identical to protect the hard disks (especially important for SSDs, see also section below).
  3. With 8 GB RAM, 16 GB RAM, 32GB or more: The virtual RAM should be about the same size as your physical RAM. EXCEPTIONS: For high resource consumption such as video editing, even with 64 GB of RAM it may be useful to increase the size of the swap file in Windows 11 and 10 to 100 GB or more in order to work smoothly.
  4. If you store large amounts of data on your hard disk: Always give it enough space to "breathe". Because once the swap file is fully occupied by the system, there should still be enough free space on the hard disk.
  5. To select the drive on which the swap file should be located: If you have multiple disks in your computer, take the faster and larger one to ensure quick access to the file in case of storage bottlenecks and to avoid problems with file growth.
This video gives a good overview of the configuration of the swap file in Windows 11

Reducing the size of the swap file - at what risk?

Wondering whether you should reduce the size of a large swap file?

For example, because pagefile.sys has swollen to a gigantic 90 gigabytes? And it's almost bursting your hard disk or Windows system partition?

You have a whopping 32 GB of RAM in your computer?

With the instructions above, you could now set a sufficient user-defined size, say 32 GB (i.e. 32,000 MB), and fix the problem in a few seconds.

To be on the safe side, you could ask ChatGPT for advice...

I was given the following advice by AI chatbot ChatGPT 4 to downsize:

"Recommendation: As a starting point, a swap file of 32 GB would be a reasonable choice for your system. This will ensure that you have enough memory for most applications and for system stability. (...) For most modern systems with plenty of RAM (as in your case), it is often sufficient to set the swap file to the same size as the physical memory. In your case, that would be 32 GB." (December 2023)

But would this size be really enough for you and your system? Permanently?

Well, in the case of this Adobe Premiere user, it was still too small at 32GB: he had reduced the swap file from 90 GB to 16 GB due to a lack of space on the system partition.

After some time, mysterious Windows crashes occurred during video editing and when exporting a 4k video.

In his use case, a size of 90 GB was entirely appropriate: As the user later measured and describes in his experience report, which is well worth reading, as much as 109 GB was necessary.

Microsoft itself writes here about the risk of too small a swap file size under Win 10:

"This condition can lead to freezing, crashing and other malfunctions"

.

According to the official documentation, swap files managed by the operating system in Win 10 automatically become up to three times as large as the physical memory (installed RAM) or 4 GB (always the higher value, but a maximum of 12.5 percent of the hard disk size) when the reserved memory reaches 90 percent of the reserved memory limit.

Reducing the size of the swap file using a user-defined size should therefore be carefully considered.

Deactivate: Should I delete the swap file in Windows 10 / 11?

Disabling Windows 10's swap file can sound tempting, especially if you think your PC has enough RAM.

But wait!

What could the consequences be?

Disadvantages and advantages of deactivation

Before you take this step, let's briefly weigh up the disadvantages and advantages:

  • Disadvantages: Deactivating the swap file will almost certainly lead to instability: Crashes, freezes of apps or the entire operating system (see example above). Even if it continues to run at first, everything could quickly slow down, as Windows and individual apps rely on the virtual memory, not just when the RAM is full.
  • Advantages: In theory, you could save memory by deactivating it. If you have a large amount of RAM and do not use memory-intensive applications. But the risk of system or app crashes is high - and this benefit is negligible.

Instructions for deactivating the swap file (NOT recommended)

We strongly recommend that you do not deactivate the swap file - some applications will no longer work after deletion. This can lead to crashes.

If for some reason you decide to try it anyway, here are instructions on how to deactivate it:

  1. Go to the System settings and select Advanced system settings.
  2. Click on the Advanced tab and then under Performance on Settings.
  3. In the next window, select Advanced and then under Virtual memory > Change.
  4. Uncheck Manage drives automatically, select your drive and set the option to No swap file.
  5. Confirm with OK and restart your PC.

But remember: the file has now been deleted. Observe the performance of your PC after deactivating it. If you notice any problems, it is better to reactivate the swap file.

In most cases, it is an important part of your Windows 10/11 system that helps to ensure stable performance.

Swap file on SSDs (with less fragmentation and write operations)

If you have an SSD in your Windows 10 or Windows 11 computer, there are a few things you should know.

Because the swap file configuration can have an impact on SSD and hard disk fragmentation, speed and durability.

Consider the service life of your SSD

SSDs are faster than traditional hard disks, but they also have their peculiarities: When swapping files to an SSD, it's important to find a balance between performance and longevity.

Too much write and read activity can shorten the service life of your SSD.

Nowadays, SSDs are much more robust than they were a few years ago.

But you can still configure your virtual memory for less fragmentation and write operations on your SSDs and hard disks with a few tips.

Optimization of the swap file for SSD & HDD

Here are some quick tips on how to optimize the swap file on an SSD for maximum performance and durability:

  1. Set the minimum initial size and maximum size the same: This prevents the swap file from constantly changing its size, which increases fragmentation and can put a strain on the SSD and slow down normal HDD hard disks.
  2. Move swap file to a larger HDD: Is the swap file on your SSD too large and there is a lack of storage space? Then move it to a larger drive (to which Windows 11 / 10 should have continuous access).
  3. Not too big, not too small: A swap file that is too large wastes valuable SSD storage space, one that is too small could affect performance. A good starting point is 1.5 to 3 times your RAM.
  4. Monitoring performance: Observe how your system behaves. If you notice that it is slowing down, it might be time to adjust the swap file size.

With these simple steps, you can ensure that your SSD or HDD and the swap file work in perfect harmony.

How to get the most out of your Windows 10 operating system with fast solid state drives

.

Storage location: Here you can find the swap file in Windows 10 and Windows 11

The file name of the swap file is Windows 10 and Windows 11 "pagefile.sys" and its default location is on the drive on which the operating system is installed.

In most cases, this is the "C" drive.

The full file path of your swap file is therefore probably:

C:\pagefile.sys

Note that it is a hidden system file.

To see them in Windows Explorer, you must change the Explorer display options so that hidden files and protected system files are displayed.

This can be set in the Explorer options under "View" or "Folder options". As soon as these options are activated, you should be able to see the pagefile.sys in the source directory of the C: drive.

PS: The hiberfil.sys (saves the entire RAM memory during hibernation) and swapfile.sys (for Microsoft apps since Win 8) are also located there, but with different functions.

Differences in swap file management in Windows 11 and Windows 10

How does the handling of the swap file differ between Windows 11 and Windows 10?

In fact, the basic principles are quite similar. However, Windows 11 brings some improvements and smarter management strategies for the swap file compared to previous versions of Windows, including Windows 10. For users with powerful systems and SSDs, this can be beneficial.

Here are a few technical details and innovations that have been implemented in Windows 11:

  • Adaptive swap file size: Windows 11 uses a more dynamic system to adjust the size of the swap file. It actively assesses memory requirements and adjusts the size of the swap file to find the best compromise between system performance and available disk space.
  • Improved memory management: The Windows 10 successor has more efficient memory management that interacts better with physical RAM and the swap file. This includes improved memory usage algorithms that help to make the swapping of data between RAM and hard disk more efficient.
  • Optimization for SSDs: Win 11 is optimized to work more efficiently with solid-state drives (SSDs). The swap file management takes into account the faster read and write speeds of SSDs to speed up the swapping of data and at the same time reduce wear and tear on the SSD.
  • Improved memory pressure algorithm: Compared to previous versions, Win 11 uses an improved algorithm to monitor memory pressure. If the system detects that physical RAM is running low, it uses the swap file more efficiently to prevent a drop in performance.
  • Integration with new technologies: Microsoft has geared Win 11 towards integration with newer technologies such as DirectStorage for games and other memory-intensive applications. This integration ensures better utilization of virtual memory in conjunction with physical hardware.

Summary

We've covered a lot, but here are the key points you should take away to improve your PC performance in Windows 10:

  • The swap file is your friend: It helps your PC to run smoothly even under heavy load by relieving the RAM.
  • Size is important: The optimal size of the swap file depends on your RAM and your system usage. As a rule of thumb: only change the size if there are problems. It should be at least 1.5 times the size of your RAM, although for compute-intensive processes such as video editing, sizes in excess of 100 GB can also be useful. And: The initial size and maximum size should always have identical values.
  • SSD users beware: With SSDs, you should make sure that the swap file is not too large so as not to shorten the service life of your SSD.
  • Caution when deactivating: Deactivating the swap file involves risks. Check carefully whether deleting it makes sense for your system.

FAQ

Here we answer some of the most frequently asked questions about the swap file in Windows 10 so that you can quickly and effectively improve your PC performance.

Images above: screenshots

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