sodcalculator

10 Tech How-To

How to Set Virtual Memory in Windows

Guide 10-34552 · Updated · Step by step

Virtual memory in Windows acts as a backup for your RAM, using a portion of your hard drive or SSD as a temporary data store when physical memory runs low. This guide walks you through adjusting the page file size—the file Windows uses for virtual memory—to help improve system stability and performance, especially if you run memory-heavy applications. You don’t need any special tools, just administrative access to your PC.

What You’ll Need

  • A Windows PC (Windows 10 or Windows 11 are covered here; steps are similar in older versions).
  • An account with administrator privileges (you’ll need to confirm a UAC prompt).
  • Knowledge of how much RAM your system has (check in Settings > System > About).

Step-by-Step

  1. Open the System Properties dialog. The quickest way is to press Win + Pause/Break (if your keyboard has it), or right-click This PC in File Explorer and select Properties. If you’re on Windows 11, you may need to click Advanced system settings on the right side of the Settings window that opens.
  2. In the System Properties window, go to the Advanced tab. Under the Performance section, click the Settings… button.
  3. In the Performance Options window, switch to the Advanced tab. Under Virtual memory, click Change….
  4. In the Virtual Memory dialog, uncheck the box that says Automatically manage paging file size for all drives at the top.
  5. Select the drive where you want the page file to reside. Usually this is your system drive (C:), but if you have a separate fast SSD, you might choose that. However, keep in mind that Windows needs a page file on the system drive for crash dumps.
  6. Choose Custom size. In the Initial size (MB) field, enter a value. A common recommendation is 1.5 times your RAM size. For example, if you have 8 GB (8192 MB) of RAM, enter 12288 MB. In the Maximum size (MB) field, enter a value that is 2 to 3 times your RAM, or simply set it to the same as the initial size to keep it fixed (which avoids fragmentation). For 8 GB RAM, that could be 16384 MB or 24576 MB.
  7. Click Set, then click OK.
  8. You’ll be prompted to restart your computer. Save any open work and restart. The new virtual memory settings will take effect after the reboot.

Common Mistakes

  • Setting the page file too small: If you set the maximum size too low, programs may crash or fail to open when RAM is exhausted. Always leave headroom.
  • Setting it on a slow drive: Putting the page file on a slow HDD while your system drive is an SSD can bottleneck performance. Use the fastest storage available.
  • Disabling the page file entirely: Some users disable it to save space, but this can cause instability and prevent Windows from creating crash dumps. It’s rarely a good idea, especially on systems with less than 16 GB RAM.
  • Forgetting to click Set: If you type values but don’t click the Set button, the changes won’t apply. The field will show “None” or the old values.
  • Setting a fixed size that’s too small: If you set initial and maximum to the same value, and that value is too low, Windows cannot grow the file when needed, leading to “low on memory” errors.

Tips

  • Let Windows manage it if you’re unsure: The default “Automatically manage” option is well-tuned for most users. Only change it if you have a specific reason, such as a program that requires a larger page file.
  • Use a fixed size for consistency: Setting initial and maximum to the same value prevents the page file from growing and shrinking, which can reduce fragmentation and improve performance slightly.
  • Monitor usage: Open Task Manager (Ctrl+Shift+Esc) and go to the Performance tab to see how much memory is in use. If your page file usage is consistently high, consider adding more RAM instead of increasing virtual memory.
  • Keep the page file on the system drive: Windows requires a page file on the system drive (C:) to create crash dumps. Even if you put a larger page file on another drive, keep a small one (e.g., 256 MB) on C:.
  • After changing, check for errors: After restart, go to the Virtual Memory dialog again to confirm the values are applied.

Troubleshooting

Changes not taking effect: Ensure you clicked Set after entering values, and that you restarted the computer. If the dialog still shows the old values, repeat the steps and make sure the checkbox “Automatically manage” is unchecked.

“Insufficient memory” errors persist: If you still get low-memory warnings, your page file might still be too small, or you might have a memory leak in a specific program. Check Task Manager to see which program is using the most memory. Also, verify that you have enough free disk space for the page file size you set.

Windows won’t boot after changes: This is rare, but if it happens, boot into Safe Mode. In Safe Mode, revert the virtual memory settings to “Automatically manage” or set a reasonable size, then restart normally.

Page file on a different drive not being used: Windows may still use the system drive page file if the other drive is slower or if the system drive is low on space. Ensure the drive you chose is healthy and has enough free space.

Performance got worse: If you set the page file on a slow drive, or if you set it too small, performance can degrade. Try increasing the size or moving it back to the system drive.

Frequently Asked Questions

Q: What is the ideal virtual memory size for 8 GB RAM?
A: A common starting point is 1.5x your RAM for initial (12288 MB) and 2-3x for maximum (16384-24576 MB). However, modern systems often work fine with Windows managing it automatically.

Q: Should I set virtual memory to 0?
A: No. Disabling the page file can cause crashes and instability, especially under memory pressure. Windows needs it for system operations and crash dumps.

Q: Can I put the page file on an SSD?
A: Yes, SSDs are fast and handle page file reads/writes well. Modern SSDs have good endurance, so the extra writes from the page file are not a major concern.

Q: Does increasing virtual memory make my PC faster?
A: Not really. Virtual memory is much slower than physical RAM. If your PC is slow because RAM is full, adding more RAM is a better solution. Increasing the page file only prevents crashes, not speed up.

Q: Why does Windows keep changing my page file size?
A: If you have “Automatically manage” checked, Windows adjusts the size based on system needs. If you set a custom size, it should stay fixed unless you change it.

Q: What happens if I run out of both RAM and virtual memory?
A: Programs may crash, and Windows may show a warning that your system is low on memory. You might need to close some applications or increase the page file size.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →