Windows swap file Topic is solved

FAQ, getting help, user experience about FancyCache
dustyny
Level 8
Level 8
Posts: 118
Joined: Sun Sep 02, 2012 12:54 am

Re: Windows swap file

Post by dustyny »

There seems to be some confusion as to what the pagefile's purpose is. Though you can disable the pagefile, you shouldn't. This is a bad practice perpetuated by people who don't really understand what the function of the pagefile really is and the perfomance gains are negligible or nonexistent if you have a SSD? In fact disabling the pagefile will actually reduce performance.

The page file isn't virtual memory in the same way virtual memory swapping is handled in the *nix (Unix, Linux, OSX) world. In the *nix world whole items (programs, files, etc) are moved/swapped out of RAM to disk to allow machines to exceed phyiscal RAM. Windows pages out small blocks of data from ram which may or may not be in use, so in the case of the kernel & drivers a copy is kept in RAM and in the pagefile for error checking and page recovery.

In the Windows world paging is much more then just virtual RAM, it's a critical function of the memory manager. Windows removes pages (chunks of RAM, not full programs and files) in and out of RAM regardless of memory use. While you may or may not see the result of this come up in a benchmarking tool, low level processes all over your computer (kernel, drivers, applications, I/O systems) will be affected negatively as Windows relies on the pagefile to perform housekeeping functions.

Another reason you need the pagefile is so Windows can perform memory error checking and correction. While a computer is running, RAM gets corrupted (even ECC) and has to be regularly refreshed, this refreshing comes from you pagefile. If no page file exists the memory manager has to load the full memory space from disk again, which is much slower then just loading a (smaller) page from the pagefile. Also when you machine blue screens your Kernel & memory dumps are pulled from the pagefile allowing you to troubleshoot your machine.

I'm not sure about Windows 8 but Windows Server 2012 won't let you disable the pagefile at all, on reboot it will create a temporary pagefile on the root of C.

The only thing you should do to optimize page performance is placing it on a fast drive or drives (if you use multiple pagefiles) where you will have less I/O contention (low read writes), set the pagefile to be a static size (generally 1.5x the size of RAM) to avoid fragmentation.

People see this gigantic file on their machine and assume that it's the enemy but it's not, it's a critical function of your computer and M.S has done an amazing job of maximizing it's performance for you. :mrgreen:
Post Reply