Optimizing your page file when you're running low on RAM is always a good idea. When all physical RAM in a computer is in use, Windows starts using the hard disk as if it were additional RAM. This is why we have a Pagefile (also called the swap file). Because RAM memory is a lot more faster than the hard disk, whenever the computer begins to use the Pagefile to relieve memory pressure, we begin to experience a drastic performance degradation.
One of the most effective things you can do to improve performance is ensure that there is enough RAM available to avoid frequent paging (swapping) of memory contents between disk and RAM.
This means that the actual limit on the memory used by all applications is the amount of RAM installed plus the maximum size of the Pagefile.
How much swap space do you need? That depends the amount of RAM you have and the programs you use. The rule of the thumb is 1.5 times the amount of system memory, unless you have too much load on your system.
SOURCE