How to disable swapfile.sys on Windows 8?

Solution 1:

It's not recommended to disable page file completely, but it you have vast amounts of RAM, you can limit it to reasonably small size, so it doesn't occupy your precious SSD space. Other than saving SSD space, disabling page file will not make PC run faster, Windows will not use page file, unless it is really necessary.

To set page file size manually, press Win+Break to open Control Panel System page, click Advanced System Settings, select Advanced tab, click Settings... (Performance group), select Advanced tab, click Change... button (Virtual memory group), uncheck Automatically..., select Custom size radio button, and enter same value in both fields. 512 MB is fine, for example. Press Set, then OK. Now you need reboot to apply new setting.

Clarification regarding David Schwartz's comment. It happens frequently that Windows allocates unreasonable amount of space for paging file (like 16G on a 16G RAM machine), during install and it will not shrink it automatically (I guess it have a "grow-only" strategy). However actual page file usage is limited to some 100-200M because main RAM is actually never became exhausted. I guess that small usage comes from some Windows architecture reasons, as David correctly mentioned. So, if you have standard HDD you don't really need to care. But if you are limited by a small SSD, saving some gigs of space can be really useful. That's the only legitimate reason I know to set page file size manually. I've remembered one more - your HDD backups can become smaller (depends on how smart is backup software you're using).

Solution 2:

The swapfile.sys is a special pagefile. for the new Windows Store apps. You can get rid of it if you disable the normal pagefile.

There is also a way to disable it, but keeping the normal pagefile.sys. Run regedit.exe, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management, create a 32Bit DWORD SwapfileControl and set it to 0.