36
6
The question of disabling the Windows pagefile has already been discussed quite a bit, for example here and here and here. People continue to upvote answers that say "you should not disable your pagefile even if you have plenty of RAM", but I have yet to see any concrete, verifiable reasons being given for this advice. As far as I can see, if you never need to read from the pagefile (because you have enough RAM) then performance could only be worse with it enabled due to Windows pre-emptively writing to it. At best, performance would be the same. I can't see how it could possibly be improved by writing data you never need to read.
So my question is:
Assuming that I have enough physical RAM for everything I do, is there any reason I should not disable the pagefile?
Let's say the version of Windows is Windows XP x64 SP2 or Windows Server 2003 x64 SP2 (same thing). If it's different for Windows Server 2008 x64 I'd be interested to hear an answer for that as well. I'm looking for specific, objective reasons from good sources, not just opinions. Something like "here are the benchmarks done with and without a pagefile and the results were better with a pagefile, even with enough RAM" or "according to this MS KB article problem X occurs if you disable the pagefile".
So far the only reasons I've seen mentioned are:
- Even if you think you have enough RAM you might run out. OK, but for the purposes of this question, let's just take it as a given that I have enough. Maybe I only ever read my email and I have 16GB RAM. Or 128GB. Or 1TB. Or whatever - but it's enough for 100% of what I do, 100% of the time. Another way to think of it is: if I have x MB physical RAM and y MB pagefile and I never run out of RAM in that configuration, would I not be better off, performance-wise, with x+y MB physical RAM and no pagefile?
- Windows is "used to" having a paging file and it might not function as reliably (from Understanding the Impact of RAM on Overall System Performance That's rather vague and I find it hard to believe, given that MS has provided the option to disable the pagefile.
- Windows knows what it's doing better than you. No - it doesn't know that I won't run more programs or load more data, but I do.
@Zifre Pre-emptively writing to the pagefile improves performance because it makes pages discardable that would otherwise have to be written before they can be discarded. When you're low on memory, I/O is typically expensive as well, so it makes sense to do the I/O earlier. – David Schwartz – 2016-03-12T23:50:23.973
@EMP The main thing you're missing is that Windows makes different decisions when it has a pagefile than when it doesn't, and those decisions can make a difference even if the pagefile is never read from or written to. The pagefile acts like a safety net that allows Windows to be more aggressive, knowing that it can use the pagefile if it has to. This allows more RAM to be used as a disk cache, which improves performance. – David Schwartz – 2016-03-12T23:51:23.587
Um, but Windows does not "write pre-emptively to the pagefile". Writes to the pagefile happen when moving pages from the modified page list to the standby page list. Pages are only put on the modified list after they've been dropped from working set(s). This notion got started because Windows XP mislabeled the "commit charge" graph in task manager as "PF usage", leading people to think a lot of pagefile usage was happening when it wasn't. – Jamie Hanrahan – 2016-04-17T22:12:22.150
Why does Windows pre-emptively write to the swap file? I can't see any reason why that would improve performance. – Zifre – 2010-07-10T01:21:23.790
I don't think this is worth its own answer, but be aware that data stored in RAM can be less reliable than data stored on disk. I've seen reports of corruption using RAM disks. RAM is volatile, disk is not. For caching data and preserving it for later use, writing it to disk gives you a minutely better chance of avoiding corruption than the tiny change of it occurring with in-RAM caching. – ssube – 2010-09-09T04:26:09.477
3@Molly: If you think this is a waste of time, then don't comment at all, just ignore and move on. Why criticize the question? You may not care, but others do. – Mas – 2011-01-28T18:01:41.617
2I feel your frustration on this.i recently went from 4gb of ddr2 to 8gb of ddr3. A guy at work says "be sure to make your swap size 8-12gb". WHY? Im doing the same stuff I was doing before, and now I have twice as much physical ram; why would I need MORE swap space? – LoveMeSomeCode – 2011-02-12T21:14:50.567
2Not subjective - please read the question carefully, particularly the assumption. I'm asking for specific reasons from reliable sources, not opinions. – EMP – 2011-02-17T04:55:28.597
14this subject has been discussed ad nauseam in pretty much every tech related forum under the sun. conclusion: do it or don't do it. if it works for you, great, get on with your life. if it doesn't, well, virtual memory just a few mouse clicks away. other than that, we're wasting our time here. better off to discuss the best browser or antivirus software! :) (btw, that link of yours is a great read, recommended) – None – 2009-08-26T23:49:51.013
1@Molly You mean, YOUR link? :) – EMP – 2009-08-27T00:31:28.047
well, i was recently referring to Mr. Posey's essay myself in a similar thread :) – None – 2009-08-27T00:46:22.883
Dupe of: Windows Swap (Page File): Enable or Disable?
– Ƭᴇcʜιᴇ007 – 2011-08-25T20:04:39.537http://www.tweakhound.com/2011/10/10/the-windows-7-pagefile-and-running-without-one/ – Kokizzu – 2013-01-19T17:20:18.440