Virtual Memory Pagefile Size: How to Set It
This guide explains how to choose the right virtual memory pagefile size in Windows. You will learn what the pagefile does, how Windows manages it by default, and the exact steps to set a custom size if you need one. The short answer: for most users, letting Windows manage the pagefile automatically is the correct setting; only change it if you have a specific reason, such as limited disk space or a program that requires a fixed size.
What Is the Pagefile?
The pagefile (often called swap file or virtual memory) is a hidden system file on your hard drive or SSD that Windows uses as an overflow for RAM. When physical memory (RAM) is full, Windows moves less frequently used data from RAM to the pagefile, freeing up RAM for active programs. This prevents crashes and out-of-memory errors, but because disk access is slower than RAM, heavy reliance on the pagefile can slow your system.
Windows names the file pagefile.sys and places it in the root of your system drive (usually C:). You can see it only if you enable “Show hidden files� and disable “Hide protected operating system files� in File Explorer options.
How Windows Sets the Pagefile by Default
By default, Windows uses a system-managed pagefile. This means the operating system automatically adjusts the file’s minimum and maximum size based on:
- Total amount of installed RAM
- Current memory usage patterns
- Free space on the system drive
On a typical system with 8 GB of RAM, the initial pagefile size is often around 1.5 to 2.5 times the RAM size, but it can grow or shrink as needed. The system-managed approach works well for the vast majority of users because it balances performance and disk usage without requiring manual intervention.
When to Set a Custom Pagefile Size
There are a few legitimate reasons to override the automatic setting:
- Limited disk space: If your system drive is nearly full, a large pagefile can consume gigabytes. You might reduce its maximum size or move it to another drive.
- Fixed-size requirement: Some legacy applications or memory-intensive games (e.g., older flight simulators) may expect a constant pagefile size and can behave erratically if it changes.
- Crash dump requirements: Windows needs a pagefile large enough to hold a memory dump on a blue screen. For a full kernel dump, the pagefile should be at least as large as your RAM.
- Performance tuning on SSDs: Some users set a fixed size to reduce write wear on SSDs, though modern SSDs handle this fine and the benefit is minimal.
If none of these apply, you should leave the setting on “System managed size.�
How to Change the Pagefile Size (Step-by-Step)
These steps work for Windows 10 and Windows 11:
- Press Win + R, type
sysdm.cpl, and press Enter. - Go to the Advanced tab and click Settings under Performance.
- In the Performance Options window, switch to the Advanced tab and click Change under Virtual memory.
- Uncheck “Automatically manage paging file size for all drives.�
- Select the drive you want to configure (usually C:).
- Choose Custom size and enter an Initial size and Maximum size in megabytes (MB).
- Click Set, then OK.
- Restart your computer for the change to take effect.
If you want to disable the pagefile entirely (not recommended), select No paging file and click Set. This can cause programs to crash if you run out of RAM.
What Size Should You Choose?
There is no single “correct� number, but a common guideline is:
- Minimum (initial) size: 1.5 × your RAM size
- Maximum size: 3 × your RAM size
For example, with 8 GB (8192 MB) of RAM:
- Initial: 12288 MB (1.5 × 8192)
- Maximum: 24576 MB (3 × 8192)
These numbers are not official Microsoft recommendations, but they are widely used and work well for most desktop systems. If you have a large RAM (16 GB or more), you can set both values to the same number (e.g., 8192 MB) to keep the file a fixed size, which avoids fragmentation and reduces disk churn.
For crash dump support, ensure the pagefile is at least as large as your physical RAM. If you have 16 GB RAM, set the maximum to at least 16384 MB.
Common Mistakes and Misconceptions
- Setting the pagefile too small: If you set it lower than what your applications need, you may get “low on memory� errors or system instability.
- Disabling the pagefile to “free up RAM�: The pagefile does not consume RAM; it uses disk space. Disabling it does not speed up your system and can cause crashes.
- Moving the pagefile to a slower drive: If you put it on a mechanical hard drive while your system drive is an SSD, you will slow down virtual memory access.
- Setting a fixed size too small: If you set both values to a low number and you later run out of space, Windows cannot expand the file and may crash.
- Believing the pagefile is “bad�: A pagefile is a normal part of Windows. Even with plenty of RAM, Windows uses it for certain operations like crash dumps and memory-mapped files.
Pagefile on SSDs vs. HDDs
On a traditional hard drive, a large pagefile can cause noticeable slowdowns because the drive’s read/write head must move around. On an SSD, access times are much faster, so the performance impact is smaller. However, SSDs have a limited number of write cycles. Setting a fixed pagefile size reduces the amount of write activity compared to a dynamically growing file, but modern SSDs have wear-leveling and high endurance, so this is rarely a practical concern for typical users.
If you have multiple drives, you can place the pagefile on a secondary SSD to reduce load on the system drive. But if that secondary drive is slower (e.g., a 5400 RPM HDD), you will likely see worse performance than keeping it on the primary SSD.
Frequently Asked Questions
Should I let Windows manage the pagefile?
Yes, for most users. The system-managed setting automatically adjusts the pagefile size based on your RAM and usage. It is the safest and most balanced option. Only override it if you have a specific need like limited disk space or a program that requires a fixed size.
What is the ideal pagefile size for 16 GB RAM?
A common recommendation is 1.5 to 3 times your RAM, so for 16 GB (16384 MB) that would be 24576 MB to 49152 MB. However, with 16 GB RAM, you may rarely use the pagefile, so a fixed size of 8192 MB is often sufficient. The exact value depends on your workload.
Can I move the pagefile to another drive?
Yes. In the Virtual Memory dialog, select a different drive and set a custom size. This can help if your system drive is low on space. However, avoid moving it to a slower drive, as that will degrade performance.
Is it safe to disable the pagefile?
Technically yes, but it is not recommended. Without a pagefile, Windows cannot create crash dumps, and programs that rely on virtual memory may crash if RAM runs out. You may also see “system ran out of virtual memory� errors. Only disable it temporarily for testing, and re-enable it afterward.
Does the pagefile size affect gaming performance?
Yes, but only if your system runs out of RAM. If you have enough RAM, the pagefile is rarely used, so its size does not affect FPS. If you have insufficient RAM, a larger pagefile can prevent stutters, but it will not match the speed of actual RAM.
How do I check the current pagefile size?
Open the Virtual Memory dialog (as above) and look at the “Current allocation� column. You can also open Task Manager (Ctrl+Shift+Esc), go to the Performance tab, and click on Memory to see the “Committed� and “Cached� values, which reflect pagefile usage.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.