Why a page file does not belong on a RAM disk
RAM Disk does not allow page files, or hibernation and crash dump files, on its disks. This article explains why a page file on a RAM disk, or on any other storage that lives in memory, takes memory away instead of adding it.
What a page file is
A page file (also called a swap file, paging file or pagefile.sys) is space on a disk that extends your computer’s memory (RAM). When the system runs short of RAM, it moves less-used memory contents to the page file. Windows also uses it to write memory dumps when it crashes.
The total memory all programs together can use is the size of your RAM plus the size of the page file. With 4 GB of RAM and a 2 GB page file, the system can offer 6 GB; a program that needs 8 GB will run out of memory. The only ways round that are more RAM or a larger page file.
What happens with a page file on a RAM disk
Now put that 2 GB page file on a RAM disk. The RAM disk takes 2 GB of your 4 GB of RAM, so you have 2 GB of RAM and 2 GB of page file: still 4 GB in all, exactly what you had without a page file. Nothing was gained, and the page file can no longer grow when it needs to, because any growth would come out of the very RAM it is meant to extend.
It is worse in practice: if a program needs 3 GB, the system must now page memory out to the page file, even though the computer physically has enough RAM for it.
Where to put the page file instead
- If you have plenty of RAM and do not need crash dumps, you can turn the page file off altogether. Some programs, such as some Adobe applications, will not run without one; for them, set the smallest page file Windows allows, on a hard disk.
- If you do not have much RAM and need a page file, keep it on a hard disk. With two physical disks, put it on the one Windows is not installed on.
- On an SSD, use a fixed page file size rather than letting Windows manage it, to avoid needless wear.
- With both an SSD and a hard disk, a page file on the SSD is faster but wears it more; on the hard disk it spares the SSD but is slower.