What are page and swap files and how big should they be?

While you probably don't need to adjust your PC's page and swap files, it's useful to know what they are when troubleshooting, or if you're trying to free up a little hard drive space. 

What is a page file?

A page file acts like a physical extension of RAM and is used to offload excess or idle data from the memory to the hard disk. It's necessary because if the main system RAM is overloaded and no page space is available, a program could crash and potentially lose data. 

What is a swap file?

The swap file and the page file perform essentially the same function. Swap files are also a reserved section of disk space that’s used for offloading data from RAM. One of the swap file's primary functions is to provide a page space for Windows Apps from the Windows Store. When a Windows app enters idle mode, it’s unloaded into the swap file until the user activates it again. This frees up some memory for more important tasks that are currently running.

The swap file co-exists alongside the page file and is much smaller in size, taking up only a few hundred megabytes of space at most. It sits silently in the background and requires no intervention from the user. If you want to check the size of your swap file, it’s listed as swafile.sys in the Windows file tree. 

Besides using only a small portion of your disk space, the swap file does not impact performance as long as it’s not being accessed constantly (nor does the page file, for that matter). This typically happens when the system is depleted of actual RAM. If this is happening to you, consider installing more RAM.

On the other hand, if you have oodles of RAM but are desperate for storage space, you can choose to shrink the size of your page file. Below are instructions for changing your page file, and how big it should be.

How do I change the size of my page file?

To change the size of your page file, navigate to the 'System' section of the Windows Control Panel. Open 'Advanced System Settings' and navigate to the 'Advanced' tab. Click the 'Settings' button under the 'Performance' section to open another window. Click on the new window's 'Advanced' tab, and click 'Change' under the 'Virtual Memory' section.

There isn’t a way to directly adjust the size of the swap file. If you have a page file enabled on your machine, which you should by default, then Windows will dynamically adjust its size for you.

How big should my page file be?

Initially, Windows will configure a page file size based on the amount of memory installed and free disk space available. If you don't run memory intensive applications (such as virtual machines and production software) other than games, you can shrink the page file down to a fraction of your total available RAM.

Personally, I have my page file configured to 2GB on a system with 16GB RAM without any issues. For users with 8GB RAM or below, I would recommend keeping the default page size.

You can also choose to disable paging completely, thus maximizing your space savings. I would strongly recommend against this as it could make your system and programs crash when you unexpectedly run out of RAM. Certain critical functions in older versions of Windows, such as a complete memory dump, would not even run with the page file disabled.