How to Change Pagefile Size and Location in Windows

Windows 11 desktop screenshot showing virtual memory and pagefile settings

Every now and then, you will see an Internet-recommended fix asking you to change the location and/or size of the pagefile or the pagefile.sys file on your Windows PC. The pagefile is part of your system’s virtual memory, used by Windows to extend the available memory for day-to-day tasks. If you know why you’re being asked to do it, follow this guide to change the pagefile size and location in Windows.

Tip: read on to learn how to fix the “page fault in nonpaged area” error in Windows

Change Pagefile Size in Windows

When Windows runs low on physical memory (RAM), it accesses the pagefile.sys system file and dumps all the least-used memory bits into that file. The system can clear up the physical RAM for any additional tasks. Windows automatically manages the pagefile size by default, so make changes only if you absolutely need to. Windows typically reserves around 1/8 of your total RAM or 4GB (whichever is larger) on your hard drive for the pagefile.

Follow the steps below to change the pagefile size:

Right-click the Windows button, select System, then Advanced system settings.

Change Pagefile Size And Location Windows System Settings

Under Performance in the Advanced tab, click Settings.

Change Pagefile Size And Location Windows System Settings Advanced

Under Virtual memory in the Advanced tab, click Change. Uncheck Automatically manage paging file size for all drives in the Virtual Memory window, select the paging file drive, and click the radio button next to Custom size. Enter the Initial size and Maximum size values for your pagefile, and click OK to save the changes.

Change Pagefile Size And Location Windows System Virtual Memory

It’s best to restart your system for the changes to take effect. Additionally, if you face high memory usage errors in Windows, try increasing the virtual memory further, although this may not completely fix the issue on its own.

Tip: need some more space? Learn how to clean up and make space on your Windows C drive.

Change Pagefile Location in Windows

To change the pagefile location, follow the steps above until the Virtual Memory window opens, then uncheck the box next to Automatically manage paging file size for all drives. Select the default paging file drive, click the radio button next to No paging file, and click Set to effectively disable the paging file on the drive you selected.

Change Pagefile Size And Location Windows No Paging File

Select the drive where you want to store the paging file, then click the radio button next to System managed size, and click Set to apply the changes. Click OK and close all the windows.

Change Pagefile Size And Location Windows Change Pagefile Location

Restart your system for the changes to take effect.

Manage Pagefile in Windows

Changing pagefile size and location is fairly easy, whichever Windows version you’re on, and it is particularly helpful when resolving errors related to virtual memory. That being said, you should only change the paging file settings if you are 100 percent sure why you’re doing it. Otherwise, it’s best to let Windows manage the pagefile automatically. Also learn what to do if Windows Start Menu Search isn’t working.

All images and screenshots by Tanveer Singh.

Is this post useful?
Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Tanveer Singh
Tanveer Singh - Staff Writer

After a 7-year corporate stint, Tanveer found his love for writing and tech too much to resist. An MBA in Marketing and the owner of a PC building business, he writes on PC hardware, technology, video games, and Windows. When not scouring the web for ideas, he can be found building PCs, watching anime, or playing Smash Karts on his RTX 3080 (sigh).