Virtual memory acts as an additional memory resource on your system if it runs out of RAM. For that, it uses some reserved disk space, which you’ll find as a hidden pagefile.sys file.
Since virtual memory uses up additional disk space automatically, it’s not necessary to manually limit its size unless you experience any system instabilities.
If however, you do run into some issues, check the total memory resources you need for your work. Then, specify the virtual memory (pagefile) sizes accordingly.
Let’s discuss everything in detail.
Recommended Virtual Memory Size
Having your system manage the virtual memory size for all drives is undoubtedly the best option.
You will experience very few issues. Just make sure to leave behind enough free space on your C drive.
If the drive doesn’t have much free space, your system will automatically use another drive for the paging file. You can also specify the next drive manually.
The only time where you may have to manually set the size is when you run into pagefile-related system issues. Even then, the amount of virtual memory you need depends on your system usage.
With larger RAMs (16+ GB), your system doesn’t need a lot of additional memory resources. But for systems with smaller ones, you’ll probably run out of memory soon.
It’s best to have a proportionally larger virtual memory in such cases.
RAM Size (GB) | Initial Pagefile Size (MB) | Maximum Pagefile Size (MB) |
4 GB | 2048 | 8192 |
8 GB | 4096 | 12288 |
16 GB | 2048 | 16384 |
32 GB | 1024 | 8192 |
For 64GB+ RAMs, the RAM itself should be enough for all purposes. So you can simply set 1-2 GB for pagefile to account for some rare circumstances.
Determine the Ideal Virtual Memory Size Yourself
The above sizes are my recommendations. They have worked for me and a lot of others, but may not be ideal for you.
It’s best to estimate the ideal virtual memory size for your system by using Process Explorer, a Microsoft SysInternals tool.
For that,
- Make sure you have enough space on your system drive.
- Open Run (Windows key + R), type
systempropertiesadvanced
, and click OK. - Click Settings under Performance, go to the Advanced tab, and select Change.
- Make sure Automatically manage paging file size for all drives is enabled.
- Run all the apps you would normally use.
- Download Process Explorer from Microsoft Sysinternals. Extract it into your local drive.
- Run Process Explorer (
procexp64.exe
). - Click on the System Information icon on the top portion.
- Go to the Memory tab and check the Peak Commit Charge.
- Now, disable the automatic paging file size and manually set it as follows:
- Initial size: Peak Charge – RAM size (in MB)
- Maximum size: Twice the initial size
- In my system, the peak commit charge was about 20489960 KB = 20009 MB and my RAM size is 8000 MB (8 GB RAM is only about 7.8 GB in real, which is slightly less than 8000 MB).
So I set the Initial Size to 20000 – 8000 = 12000 MB, and the Maximum size to 24000 MB. - If the peak commit charge is less than the RAM’s capacity, set the Initial size to 2048 MB and the Maximum to double that amount.
Extra Tips
- If you are using an SSD and an HDD, create the pagefile on the SSD for better performance.
- If you are only using hard drives, create the pagefile on the OS partition. If you only play computer games, you can also use the game volume for this purpose.
Isn’t Higher Virtual Memory Better?
Higher virtual memory isn’t always better as it’s slower than RAM and is used mainly as a backup for active processes.
It stores less critical data from RAM, allowing more space for important tasks. Over-reliance on virtual memory can reduce performance due to its slower speed.
Additionally, a larger virtual memory may also bring about the following problems:
- Since a storage drive (even if it is an SSD) is much slower than RAM, using the pagefile impacts your system performance.
- The performance hit will be more severe on a hard disk as it frequently suffers from fragmentation.
- The paging file will use up a lot of vital disk space.
- The higher number of write operations also uses up the limited write cycles of an SSD. This will affect its health and decrease its lifespan.
What Happens if I Specify Less Virtual Memory Instead?
Your computer uses the pagefile both as additional memory resources and to store memory dumps.
A smaller virtual memory affects both of these features and causes the following issues:
- Some apps may crash due to a lack of memory resources.
- A lot of apps come with memory optimization techniques to limit memory usage when it’s not enough. You may experience lags and performance issues when running such apps.
- Frequent stutters or latency issues when opening apps or running any task.
- Blue Screen of Death (BSODs) may not create bigger dump files.