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.

jerrykobes
  • 199
  • 1
  • 1
  • 3
  • 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 '12 at 03:12
  • 4
    Why would you want to disable all these, makes no sense. – Moab Nov 29 '12 at 03: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 05 '13 at 01: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! – Simon MᶜKenzie Mar 17 '13 at 23:08
  • Related: [What is the purpose of “C:\swapfile.sys” in Windows 8?](http://superuser.com/questions/483302/what-is-the-purpose-of-c-swapfile-sys-in-windows-8) – Ƭᴇcʜιᴇ007 Jan 29 '15 at 19:28

2 Answers2

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.

magicandre1981
  • 97,301
  • 30
  • 179
  • 245
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).

Petr Abdulin
  • 1,746
  • 2
  • 16
  • 25
  • 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. – David Schwartz Feb 05 '13 at 07:28
  • Sorry @DavidSchwartz, I don't get you. By that I mean, I don't understand how is my answer contradicts with your arguments. – Petr Abdulin Feb 05 '13 at 08: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? – David Schwartz Feb 05 '13 at 08: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 '17 at 12:35
  • @PetrAbdulin, `swapfile.sys` and `pagefile.sys` are two different files – AaA Nov 20 '17 at 12:36
  • @AaA indeed it is. While I was not actually answering question, I felt it was worth to note that disabling page files completely is actually not a good idea. – Petr Abdulin Nov 21 '17 at 05:43