How big should I make my page file? It’s a question which has haunted humanity throughout the ages and for many of us the answer remains elusive. Well fear not – in this post we will cover exactly what you need to know to figure out how big you should make your page file.
Why Should I Care?
Good question. Let’s see why. Back in the days of x86 computers with 4 GB of RAM, the standard practice was to make your page file some multiple of RAM in size. For example, in your 4 GB server you could make it 1.5x the amount of RAM and set it to 6 GB. But that formula becomes questionable when you start dealing with x64 servers with large amounts of RAM. Does your SharePoint vm with 32 GB of RAM really need a 48 GB page file? What if you have six of these SharePoint vm’s and they really only need a 4 GB page file but they each have a 48 GB page file? That’s 264 GB of valuable SAN disk space you’re potentially wasting. And besides, wouldn’t you just feel better knowing that you, the page file sizing wizard, used a logical and organized process to set the size of your page file rather than just using a random formula?
There’s one other benefit I should mention before we move on. If you understand how to correctly size the page file you are well on your way to understanding the internals of Windows memory management and this is something you want to know well if your goal is to be the best Windows engineer/administrator out there.
Virtual and Physical memory – know the difference
The key to understanding page file sizing is to know the difference between physical and virtual memory. Let’s get something important out of the way first – virtual memory has nothing to do with virtual machines. Whether Windows is running on a physical hardware or a virtual machine, virtual memory is still present. So keep that in mind when reading through this post because we’ll be talking a lot about virtual memory.
Also, when I talk about physical memory I’m not talking exclusively about RAM. As we’ll see in this post, the page file is also included as part of physical memory. So when I use the term physical memory I’m referring to the memory presented by the page file and RAM.
The first definition we need to cover is page. A page is simply a chunk of memory. Every process running in your system has a certain number of memory pages assigned to it, inside which its data is stored. In addition, every page has an address and this address is used to identify and access each page. An example of an address would be 0x03FF.
With that out the way, let’s look first look at a world without virtual memory. In the figure below, we see a system with six pages of memory whose addresses range from A – F and whose size is 1 MB, for a total of 6 MB of RAM. This is drastically simplified since most systems will have more RAM, much smaller pages sizes (e.g. 4 KB) and the addresses would not be so simple. However, for the purposes of illustrating these concepts this simplification is beneficial.

As you can see, Word has pages A, B and C, Excel has pages D and E, and Notepad has page F. In this example, the processes are seeing the physical memory directly and being assigned pages directly as well. In other words, when Excel attempts to write data to what it sees as page D, it really is modifying the contents of the page in RAM with address D. Now that we’ve seen a physical memory-only example, let’s see how the introduction of virtual memory changes the picture.
Virtual Memory – It’s an Illusion
What virtual memory does is present a completely “fake” memory address space to each process. It looks and acts like the RAM in our first example but it’s not! For example, Word may think that it’s using page F but it may very well actually be using page A in physical memory. Behind the scenes, Windows tracks this in a table so it knows which pages a process thinks it’s using and which pages it is actually using. This is known as a page table.
In combination with paging, we’re now able to present the memory provided by the page file as part of our available memory. Remember that in our very simplified example above, each memory page is 1 MB in size and we have six of them for a total of 6 MB. Now let’s say we add a 6 MB page file. Now, we have an additional six pages of memory we can assign to our processes. Without installing any extra RAM, we’ve increased the capacity of our system using significantly cheaper disk!
Now, you may be wondering – why go through this hassle? There are some good reasons for using virtual memory and paging:
- Each process can get its own, large contiguous virtual address space. This way, the memory pages that Word is accessing are isolated from the pages that Excel is accessing and there is less memory fragmentation.
- You can run more processes concurrently thanks to the inclusion of the page file as available memory. In our sad world without virtual memory, we were limited to the installed amount of RAM. Once virtual memory and the page file came into the mix, we doubled our available memory without adding any RAM.
Let’s take a look at our address space with virtual memory in the mix.
There are some important things to note in this diagram:
- The number of usable pages in our virtual memory space is equivalent to the number of pages in our RAM and page file combined. In other words, our total virtual memory available for processes to use is equal to the installed RAM plus the size of the page file. Please read this statement over and over until you fully understand it because it’s central to what will come later on when we figure out how big to make our page file.
- The blue line indicates a barrier through which the processes on the system cannot see. In other words, the actual physical memory represented by the page file and RAM is not visible to processes like it was in the first example – they can only see and interact with their own virtual address space with Windows handling the subsequent interaction with the other side of the barrier.
Putting It All Together
Now that we have virtual memory defined, let’s revisit our Word/Excel/Notepad scenario from above and see how it would look with virtual memory in play.

Let’s go over the important points in this diagram.
- Notice how Word, Excel and Notepad have their own contiguous memory spaces. Each of them has been presented with their own private virtual address space for their own use
- There is no correlation between what pages a process is using in its virtual address space and what pages it is using in physical memory. For example, Word is using pages A, B and C in its virtual space but pages B, F, and C in physical memory.
- Two of Excel’s pages (E and F) are backed by the page file and not by RAM. Remember, as far as the process is concerned, it’s just accessing memory – it has no idea that the physical pages backing its virtual pages are in the page file.
- Remember the barrier represented by the blue line – the processes cannot see the physical memory they’re ultimately using and the mapping of what physical pages their virtual pages correspond to is handled by the OS in a page table.
This Is All Very Interesting, But How Does It Relate To Page File Sizing?
We finally have enough knowledge now to move onto the whole point of this post – how big does my page file need to be? You could sum up the role of page file in the context of our discussion so far like this: it acts as the physical backing for the virtual memory which Windows has committed to make available to a process. In other words, if Windows told Word that it could have 3 MB of memory, the following must happen:
- Windows must give Word 3 MB of virtual memory
- Windows must guarantee that there will be 3 MB of physical memory available to back the virtual memory, either in the page file or in RAM
Which brings us to our critical definitions. These two terms are vital to understanding how to correctly size a page file.
- Commit Limit – The total amount of virtual memory available for processes. Equal to approximately the sum of the total amount of RAM and the size of the page file(s).
- Commit Charge – The total amount of virtual memory which Windows has given to processes. This number cannot exceed the Commit Limit – if it does, you have run out of virtual memory and you will start experiencing application crashes and general system instability.
Let’s relate these terms to our sample system from above. Our Commit Limit would be 12 MB. This is the sum of 6 MB of RAM and 6 MB of page file. Our Commit Charge would be 7 MB, the sum of the 1 MB pages which are in use by Word, Excel and Notepad.
To solidify this important concept further, let’s look at a few more examples:
- 12 GB RAM + 4 GB Page File = 16 GB Commit Limit
- 64 GB RAM + 4 GB Page File = 68 GB Commit Limit
- 48 GB RAM + No Page File = 48 GB Commit Limit
The Commit Charge and Commit Limit can be viewed in Task Manager under the System section. In this screenshot, the 4 represents the Commit Charge and the 23 represents the Commit Limit. In other words, on this particular system there was 4 GB of virtual memory assigned to processes out of a possible total of 23 GB (RAM + Page File). How many times have you seen those numbers in Task Manager and wondered what they really mean? Now you know!

So how do these terms relate to page file sizing? Remember that the page file and RAM are the physical backing for committed virtual memory. This means that for every single MB of committed virtual memory, there must be an equivalent amount present in either the RAM or page file. Therefore, if at any point Windows has committed more virtual memory than there is installed RAM, the backing for any subsequent virtual memory must come from the page file. However much your committed memory exceeds your installed RAM under peak load is the minimum size your page file needs to be. Crazy, isn’t it? It’s not related at all to how much RAM you have multiplied by some magic number and furthermore, you can’t know beforehand how big your page file should be – the figure can only come from performance monitoring of the system under peak load.
Let’s look at some examples to illustrate how the minimum size of the page file should be calculated. For these hypothetical scenarios, you’ve set up performance monitor to record Memory\Committed Bytes which is your Commit Charge. You’ve set it to run for long enough to capture the value under the peak load this system will face. You’ve set the page file size to System Managed to allow Windows to automatically size it since you don’t yet know how big you should make it (we’ll cover later why I don’t recommend leaving this option enabled).
Scenario 1
After collecting your data under peak load you establish that the highest value of your Commit Charge was 16 GB (orange arrow). Gigabytes 1 through 12 were covered by your physical RAM but notice that 13 through 16 had no physical RAM to back them (represented by the dotted blue box). Remember that every single MB of committed virtual memory must be backed by RAM or the page file therefore the 4 GB excess of committed memory on this system must be backed by the page file. Which in turn means that your page file must be a minimum of 4 GB.

Scenario 2
In this scenario, your captured performance data indicated that your Commit Charge was 100 GB (orange arrow). Your server has 128 GB of RAM in it so now we have the opposite situation to our first scenario – you had less committed virtual memory than your total RAM. Notice how there is no deficit blue dotted box representing virtual memory that couldn’t be backed by your RAM. So what does this mean? Technically it means you don’t need a page file on this server because you never committed more virtual memory than your total RAM could support. Having said that, Microsoft’s recommendation is to always have a page file so in cases like this where your performance monitoring shows you don’t need a page file I usually set it to 4 GB (see the Some Conditions Apply section below for details on why I recommend this number).

We’ve covered what the minimum size should be in our examples above, but what about the maximum? Over time, the load on your server might increase beyond the peak load that you used for your initial calculation which would cause your minimum page file size to not be big enough. To account for this, you can set your maximum to double your minimum (8 GB in our example).
Can’t I Just Set It To System Managed And Call It A Day?
You’ve probably looked at the option to allow Windows to “Automatically manage paging file size for all volumes” and wondered what exactly it means.

Armed with the knowledge you’ve gained so far in this post you might be able to take an educated guess as to what this option does. It tells Windows to watch your Commit Charge and when it reaches 90% of the Commit Limit it increases the size of the page file to accommodate. When and if the Commit Charge drops again it will shrink the page file. There are two drawbacks to this option:
- While Windows is increasing the size of the page file, requests to commit virtual memory can fail. This is a BAD THING that you do not want happening. The error message in the “Virtual Memory Minimum Too Low” dialog which Windows displays while the page file is expanding warns you of this:
- If you are running Windows 2008 R2 or lower, choosing this option will set the minimum page file size to whatever your RAM size is. If you were the owner of the server in our imaginary scenario 2 above, your page file size would be set to 128 GB when in fact you could get away with a minimal page file of 4 GB. In other words, an immense amount of disk space wasted for nothing!
To summarize, I don’t recommend selecting this option – especially now that you have the knowledge to properly size your page file.
Some Conditions Apply, See Store For Details
Sometimes the minimum size of your page file is dictated by other requirements even if your performance monitoring shows that you need a very small page file. The primary role of the page file which we’ve covered so far is to act as the physical backing for committed virtual memory. One of the other roles of the page file is to capture memory dumps in the event of a blue screen. If your IT department's policy is to always capture a full memory dump then your page file’s minimum size must be the size of your RAM + 257 MB (see https://support.microsoft.com/en-us/kb/2860880 for details). If there is no such policy and you find yourself in a situation similar to scenario 2 above where your performance monitor results show that you don’t need a page file, I recommend setting it to 4 GB. This should be enough to capture a kernel memory dump in virtually all cases.
Conclusion
Congratulations on making it this far! This was a pretty lengthy post but trust me, if you can understand the concepts presented here you are way ahead of the game and well on your way to a solid understanding of the intricacies of memory management in Windows. I want to end this post with a brief summary of the main points we covered:
- Virtual memory is presented as a per-process address space which is abstracted from the actual physical memory backing it
- One of the roles of the page file is to act as the physical backing for committed virtual memory
- Windows will not commit more virtual memory than the total size of your RAM and page file(s). In other words, the Commit Charge cannot exceed the Commit Limit
- To calculate the size of your page file, you need the highest value of your Commit Charge under peak load. However much this value exceeds your total RAM is the minimum size your page file should be.
- Set your maximum page file size to some ratio of your minimum (double is a good starting point) and you’re done.
- If your peak Commit Charge doesn’t exceed your total RAM then you just need a nominal sized page file (e.g. 4GB) unless you need to capture full memory dumps.