When physical RAM becomes heavily loaded by 4K video rendering, heavy database instances, virtual machines, or high-end gaming, Windows 11 relies on “Virtual Memory” to maintain system stability. Virtual memory offloads inactive memory blocks (pages) from high-speed physical RAM onto your storage drive in a hidden system file named pagefile.sys. By default, Windows manages paging file allocation automatically. However, default automatic sizing can lead to drive fragmentation, unexpected disk exhaustion, or micro-stuttering. Configuring and customising your virtual memory paging file manually allows you to lock optimal memory boundaries and relocate swap storage to faster NVMe SSD drives.
Why Customise Windows 11 Virtual Memory?
While Windows 11’s default dynamic allocation works for casual browsing, manual configuration delivers distinct performance advantages:
- Prevent Drive Fragmentation: Setting identical “Initial” and “Maximum” file sizes prevents Windows from constantly shrinking and expanding
pagefile.sys, keeping the allocation contiguous on disk. - Prevent Out-of-Memory Application Crashes: Demanding applications that commit memory beyond physical RAM limits will not crash with “Out of Memory” errors if a generous fixed pagefile is provided.
- Relocate to Fast Secondary NVMe Drives: If your system drive (C:) is constrained for space, moving the primary paging file to a dedicated, high-speed secondary SSD frees up valuable space on your OS drive.
- System Crash Dump Preservation: A properly sized pagefile ensures the Windows kernel can write complete crash dump files (
MEMORY.DMP) during Blue Screen of Death (BSOD) diagnostic analysis.
Calculating the Optimal Paging File Size
Microsoft’s standard memory engineering guidelines recommend the following sizing calculations based on installed physical RAM:
| Installed RAM | Recommended Initial Size (1.5x RAM) | Recommended Maximum Size (3x RAM) |
|---|---|---|
| 8 GB | 12,288 MB (12 GB) | 24,576 MB (24 GB) |
| 16 GB | 24,576 MB (24 GB) | 49,152 MB (48 GB) |
| 32 GB+ | 8,192 MB to 16,384 MB (Fixed) | 16,384 MB to 32,768 MB |
Tip: For systems with 32 GB or 64 GB of physical RAM, you rarely need more than 16 GB of swap space unless running massive data science arrays.
How to Customise Virtual Memory in Windows 11
Follow these steps to access advanced memory configuration:
- Press Win + R to open the Run dialogue box.
- Type
sysdm.cpland press Enter to open System Properties. - In the System Properties dialogue, select the Advanced tab.
- Under the Performance section at the top, click the Settings button.
- In the Performance Options window, select the Advanced tab.
- Under the Virtual memory section, click the Change… button.
Configuring Fixed Paging File Dimensions
In the Virtual Memory dialogue:
- Untick the checkbox at the very top labelled Automatically manage paging file size for all drives.
- Select your fastest SSD drive letter from the drive list (e.g.
C:or a high-speed secondary NVMe drive). - Select the Custom size radio button.
- Enter your calculated memory values in megabytes (MB):
- Initial size (MB): Enter your base allocation (e.g.
16384for 16 GB). - Maximum size (MB): Enter the same number (e.g.
16384) to create a fixed-size file, or up to 2x for a dynamic upper ceiling.
- Initial size (MB): Enter your base allocation (e.g.
- Crucially, click the Set button. (If you omit clicking “Set”, your changes will not be registered).
- Click OK. Windows will notify you that a restart is required to apply the modifications.
- Click Apply > OK, and reboot your computer.
Moving the Paging File to a Secondary Drive
If you wish to move pagefile.sys off your primary C: drive completely:
- In the Virtual Memory dialogue, highlight drive
C:, select No paging file, and click Set. - Highlight your secondary drive (e.g.
D:), choose Custom size or System managed size, and click Set. - Click OK and restart Windows 11.