Moving the pagefile to RAM is a ridiculous notion Just turn it off and by more RAM.
No matter how much RAM you have, you want the system to be able to use it efficiently. Having no paging file at all forces the operating system to use RAM inefficiently for two reasons. First, it can't make pages discardable, even if they haven't been either accessed or modified in a very long time, which forces the disk cache to be smaller. Second, it has to reserve physical RAM to back allocations that are very unlikely to ever require it (for example, a private, modifiable file mapping), leading to a case where you can have plenty of free physical RAM and yet allocations are refused to avoid overcommitting.
Consider, for example, if a program makes a writable, private memory mapping of a 4GB file. The OS has to reserve 4GB of RAM for this mapping, because the program could conceivably modify every byte and there's no place but RAM to store it. So immediately, 4GB of RAM is basically wasted (it can be used to cache clean disk pages, but that's about it).
Memory Management is handled by the CPU and whether the pagefile is on or off makes not one iota of difference to how pages are treated. It's transparent to Windows.
The page priority doesn't change, pages will be discarded just the same. Pagefiles are used by the CPU as secondary storage, not the OS. It's nothing more than level two cache fwhen level one (RAM) runs out.
A quick and very dirty example:, my machine has 16GB of RAM and no pagefile. 5 mins ago with 13GB in standby and only 2GB free, I loaded Fallout 4.
The low priority pages were discarded as Fallout loaded.
Btw on a side note, the 2008 Technet Blog on Pushing Windows Memory Limits is very misleading - I would say to the point of deception.
https://i.sstatic.net/wXkmi.png
I'm dubious as too whether even Mark wrote it, but I hope not, as it would change my perspective of him.....
Fwiw there are gaping holes in the article which I'm dumfounded no one has picked on considering how often that blog has been refer
- The pagefile and it's location are handled by Windows, the trapping of memory access to locations that have been paged out to disk would be caught by the CPU, but handed to the operating system to retrieve the page from disk and load it in.
Anyway here is one not so vague description:
Windows cannot reach higher addresses than the CPU - it's not possible.
No matter what the OS is capable of it still limited by the hardware it runs on.. because the OS is actually the CPU itself (internal registers).
OK, so pagefile is an area on the HDD which the CPU uses for extended physical address space when it can't physically or architecturally use more RAM.
On segmented x86 32bit architecture for example there are two 2GB segments of RAM.
One is allocated to the kernel. The other 2GB is for user mode.
That's all the RAM the CPU can use with 32 DRAM pins, but a 32bit process has 4GB available so what to do. Well luckily the CPU can use secondary storage AKA the hard drive for storing the extra 2GB of pages. Because it has internal registers
The physical locations where virtual pages referenced by the process don't have to be stored in RAM. But they do have be stored somewhere by the CPU.
The CPU can't give all 4GB RAM to the app, but it can give it 4GB of address by using the HDD as secondary cache (which is all the HDD really is)
The pages are moved in and out of RAM through it's internal paging mechanism, but this is not the same as a pagefile. Paging always occurs....
The bottom line is really not that complicated. For the last 15 or so years many end users have been given the impression a pagefile is some integral part of the Operating System, it is not. It never has been. This misconception is partly fuelled by corporations like Intel and Microsoft.
RAM is a fast storage device, the Hard Drive is a slower storage device, so essentially RAM is level 1 cache, the Hard Drive is Level 2 (disregarding CPU cache for this analogy). Both can be accessed by the CPU.
If not enough RAM is available for the CPU to store the pages it needs to, the HDD can be used as an overflow. If there is plenty of RAM, then the PF is redundant.
Up until Core 2, Intel processors had a 32pin DRAM bus, and 32 registers meaning the CPU had access to 4GB of RAM, and 4GB of HDD space (pagefile). This is an architectural hardware limitation, not a Windows limitation.
The total available for processes was 3.5GB, because a page table takes up 512MB. Which is why 3.5GB shows up in Windows with Intel CPU's (up until Core 2). Add a GPU and even less is available.
Xeon could access a total of 32GB RAM, 64GB of Physical Space with HDD included (pagefile again). (This ^ covers PAE,-more to come with links added).
http://www.windowsdevcenter.com/pub/a/windows/2004/04/27/pagefile.html
3rd screenshot source:
System V Application Binary Interface
AMD64 Architecture Processor Supplement Draft Version 0.99.7
I intend to continue improving this answer and adding source material and relevant info. I'd like to achieve a balance between not enough information and too much technical information.
Suggestions are welcomed. Please don't downvote just because it may not be written so well.