There are three main reasons why you might want to change the size of the paging file.
The system commit limit isn't large enough to support the system commited virtual memory requirements of your particular workload.
The paging file is taking up a significant amount of hard drive space.
You want to configure the system for a crash dump.
The primary thing people need to be aware of when it comes to the paging file is something called the system commit limit. The system commit limit is calculated based on the amount of physical memory the system has and the size of the paging file(s). When a process allocates certain types of virtual memory; private and page file-backed, the allocation is counted towards the system commit limit. Windows is making you a commitment those pages of memory will reside in RAM or can be stored on disk in a paging file.
In terms of sizing the paging file, if the amount of system committed virtual memory exceeds the amount of physical memory you have when you have loaded up your most demanding workload, the "Minimum" will need to be at least the difference between those two values. For example, you have 8GB of RAM and your workload requires 11GB of system committed virtual memory. You will need to set the "Minimum" to at least 3GB. It would be sensible to add an additional amount to that value so you have plenty of breathing room. For the "Maximum" size, there is no reason to set this to the same value as the "Minimum" size. The paging file only expands if there is a demand for it and as long as the "Minimum" is large enough, the paging file will never need to grow. In fact, you could set the "Maximum" to a very large number because it could prove useful in situations where an application is leaking virtual memory.
While I would recommend having a paging file, I feel there is far too much scaremongering around the subject. It has even gotten to the point whereby certain developers have written their applications based on the assumption a page file is necessary. Mark Russinovich himself assured me a page file is absolutely not necessary for Windows to function correctly and any application requiring a paging file to function is based on that misconception. However, none the less if you try and run these applications with no paging file, they will fail to run correctly. This is something to consider.
Mark Russinovich said:
These apps could very easily be querying directly for the existence of a paging file and failing if one’s not present, based on the misconception that one is necessary.
This is going to be a rather simplified version of what is happening but hopefully it will be straight forward enough and illustrate why a paging file is not necessary. When a modified private or page file-backed page is removed from a processes working set, the page will be put onto the modified page list. Those modified pages will eventually be written to disk and then subsequently moved to the standby page list. The modified page list is counted towards the "In use" counter (I believe) in memory statistics. This is why having a paging file is good practice. You want to move those infrequently accessed pages out of processes working sets and onto the standby page list where they can become available for other purposes.
If you have no paging file, in those instances, pages on the modified page list have no where to be written to and will therefore stay resident in physical memory occupying space. This does not cause any problems. The system will still function absolutely fine in these cases. It will just mean you will have less physical memory available to you.
What if you have enough physical memory to support the system committed virtual memory requirements of the system, you have set up Windows so it doesn't require a crash dump, and you have no applications that unnecessarily require a paging file, why have one? It's to allow the system to use physical memory in the most efficient way possible. What if you have so much "Available" physical memory, letting the modified page list grow isn't going to have much of an impact on the performance of your system. In those circumstances, disabling the paging file isn't going to make any difference to the performance of your system anyway. Everything in your performance interest will already be resident in physical memory.
As Armageus has already pointed out, the
Pushing the Limits of Windows Series articles are well worth reading.
Pushing the Limits of Windows: Physical Memory
Pushing the Limits of Windows: Virtual Memory
Pushing the Limits of Windows: Paged and Nonpaged Pool
Pushing the Limits of Windows: Processes and Threads
Pushing the Limits of Windows: Handles
Pushing the Limits of Windows: USER and GDI Objects – Part 1
Pushing the Limits of Windows: USER and GDI Objects – Part 2