8

It's possible to disable pagefile.sys and hiberfil.sys, however, there does not appear to be information on how to disable swapfile.sys.

The file swapfile.sys appears to be an additional paging file from Metro and I'd like to know if there is a way to disable it as well.

5
  • it should be noted that pagefile.sys, at least for me, is rarely used by windows 7. I moved my pagefile to another harddisk, which is on sleep most of the time because windows never uses it, never exceeds 8gb of memory. This is in contrast to windows xp which would always use the pagefile even with plenty of memory left.
    – cloneman
    Nov 29, 2012 at 3:12
  • 4
    Why would you want to disable all these, makes no sense.
    – Moab
    Nov 29, 2012 at 3:48
  • 3
    MS has repeatedly said that disabling the pagefile, even on high memory systems, can lead to lower performance and they do not recommend it.
    – Keltari
    Feb 5, 2013 at 1:51
  • 1
    @Moab, it's not a great reason, but I needed to remove this file because my aging SSD can't handle many more writes, and removing this file means I might get another 6 months out of the drive before I'm forced to replace it! Mar 17, 2013 at 23:08

2 Answers 2

9

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).

6
  • This makes no sense. If it was going to use space, that would mean it needed that space. Why wouldn't you want it to use it if it was actually needed? And by disabling it, you force Windows to behave badly -- its virtual memory architecture is designed for cases where backing store exceeds physical RAM. Feb 5, 2013 at 7:28
  • Sorry @DavidSchwartz, I don't get you. By that I mean, I don't understand how is my answer contradicts with your arguments. Feb 5, 2013 at 8:09
  • Why would you want to limit the pagefile size? It won't actually use the space unless it needs it. And if it needs it, why wouldn't you want it to have it? Feb 5, 2013 at 8:13
  • Because in my case "designed for cases where backing store NEVER exceeds physical RAM". if it does, it means my server is in a big trouble!
    – AaA
    Nov 20, 2017 at 12:35
  • @PetrAbdulin, swapfile.sys and pagefile.sys are two different files
    – AaA
    Nov 20, 2017 at 12:36
11

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.

2
  • Wow I didn't know hibernate and fast startup were related! You have a source on this?
    – mtone
    Feb 5, 2013 at 3:52
  • sorry, this was not correct. I've removed this wrong part. To kill the new file, disable the normal pagefile. Feb 5, 2013 at 4:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .