Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.
share|improve this question

closed as not constructive by Tom Wijsman, Sathya Feb 18 '11 at 13:28

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

14  
this 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) –  Molly7244 Aug 26 '09 at 23:49
1  
@Molly You mean, YOUR link? :) –  EMP Aug 27 '09 at 0:31
    
well, i was recently referring to Mr. Posey's essay myself in a similar thread :) –  Molly7244 Aug 27 '09 at 0:46
    
Why does Windows pre-emptively write to the swap file? I can't see any reason why that would improve performance. –  Zifre Jul 10 '10 at 1:21
1  
I 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 Feb 12 '11 at 21:14

12 Answers 12

This is a micro-optimization. The point is that there's no reason to do it, in anything resembling normal operation. It could easily hurt you if your usage pattern changes.

In specialized cases it might make sense, such as if there is no local writeable disk.

share|improve this answer
    
I agree just leave it on. –  user10547 Sep 10 '09 at 2:57
    
Can Windows even boot from a non-writable disk? –  salmonmoose Sep 10 '09 at 9:39
    
Yes, but you need to alter many things to get it to work. E.g. the registry must be on a writable disk, so you need to redirect it into a ramdisk, etc. ... –  Christopher Sep 14 '09 at 10:19
1  
Of course there's a reason to disable your swap - the primary one is that Windows swaps out application memory even when physical memory is free. So whenever you come back to your computer after leaving it for an hour you spend an inordinate amount of time while the hard drive thrashes repopulating your physical RAM. It is absolutely TERRIBLE advice to say there's no reason to disable a swap file. –  PP. Jan 15 '10 at 17:40
    
Have you actually noticed a speedup from disabling the pagefile? I personally have not, and from what I've read, most people don't. As @Captain Segfault said, this is a micro-optimization. –  Sasha Chedygov Sep 9 '10 at 2:35

From this link:

NOTE: Microsoft strongly recommends that you do NOT disable or delete the paging file.

To disable the use of the paging file in Windows XP, you should have at least 768MB of RAM.

Here's a link to Jeff Atwood's take on it.

share|improve this answer
    
Note: I think that number is way too low, you should have an extreme amount of memory before disabling the pagefile, and I'm sure you'll still encounter various problems. –  Lance Roberts Aug 26 '09 at 23:43
    
They don't give the reason for that recommendation, though - and I suspect it's simply because most users don't know whether they have enough RAM, so it's a good "rule of thumb". As for apps allocating memory they don't use, that memory should be "reserved", not "committed", so it only uses up virtual address space. If they do commit a lot of memory they don't need a pagefile wouldn't really save me. –  EMP Aug 27 '09 at 0:29

There are many reasons to keep the pagefile even if you can fit everything into RAM.

The answer on SF has 125 upvotes and links many credible articles. Check it out:

http://serverfault.com/questions/23621/any-benefit-or-detriment-from-removing-a-pagefile-on-an-8gb-ram-machine/23684#23684

share|improve this answer
3  
while all this may be true and i most certainly agree, i gladly provide a link where Microsoft (the guys who spent so much time thinking about it :) explicitely reccomend to disable virtual memory (no pagefile on my eee pc for almost 2 yrs, long before MS released those guidelines). having that said, on a desktop computer with a modern hard drive and monster cache memory, it just doesn't make a difference. however, everyone to their own. the link (PDF, p.10): download.microsoft.com/download/2/0/a/… –  Molly7244 Sep 10 '09 at 3:41
3  
If your eee is 2 years old, it has a first gen SSD in it. Disabling the page file on that will extend the life of the SSD, but obviously isn't a standard case. –  MDMarra Sep 10 '09 at 11:14
    
i didn't say stantdard procedure, didn't i? :) and i will not recommend to disable pagefile as 'good computing practice', however, if someone wants to do it then let 'em. it has proven to be working without hickups time and time again, despite all the 'bad stuff' that will happen. and if it doesn't work, well, a brand new pagefile is only a few clicks away. and if you're suffering from a slow hard drive/ssd there are programs that will allow you to assign system memory as hard drive cache to speed up paging. –  Molly7244 Sep 10 '09 at 11:55
    
I've read that answer (in fact it's linked in my question) and it was the very reason I posted this question. –  EMP Sep 16 '09 at 4:44

I've been running a Windows XP SP3 Professional 32bit laptop with 4GB of RAM (Windows 'officially' recognizes only 3 GB of it) for over a year now without a pagefile. People in my circles also kept trying to scare me that I shouldn't have done that.

I use very memory-intensive applications -- at any given point in time, I have at least two virtual machines (vmware) on which are configured to run 100% in RAM, I have at least one instance of Visual Studio (which has lots of add-ons installed), SQL Server and several 'small' apps such as email, IM, IE, etc.

Apart from all this, I've also got a permanent 256 MB Ramdisk. Once in a while, I use Adobe Photoshop WHILE the rest of the applications are running. And I play several games, too, including Quake3, Neverwinter Nights, Oblivion.

And I DON'T have ANY problems.

Note to BlueNovember: our friend has very graciously asked for objective reasons. So statements such as "I suspect ..." are unwarranted. Please find out before posting! Hibernation has nothing to do with paging. It uses a separate file called hiberfil.sys and you can hibernate without a pagefile.

PS: Sorry dude, I refuse to go back to a 'normal' configuration so that I can actually benchmark how much faster this setup is, but just having to see so much lesser of that hard disk activity led flickering is very comforting. I'd disable the pagefile just for that, if nothing else, as at least your computer 'feels' faster when the HDD LED isn't flickering constantly.

The ONLY reason to not disable the pagefile is if you are using Performance Monitor (PerfMon) as this depends on the pagefile and requires minimum a 2 MB pagefile or else the counters will be missing for the following objects: Cache, Memory, Objects, Processor and System.

share|improve this answer
1  
you will always find people who feel inclined to tell others how they should operate their computers, fuelling the culture of fear ("bad stuff" will happen survive2012.com) –  Molly7244 Sep 10 '09 at 3:02
    
Heh. Good one. And you'll notice I've tried as far as possible to stay away from that. ;-) I'm just describing what I'm doing, leaving analysis and acceptance as a free choice to the readers. But I do want do try and dissolve this myth that your PC will blow up in your face if you disable the pagefile. –  Veer Sep 14 '09 at 5:14
    
I've been using my laptop running Vista 32-bit with 4GB of RAM (Microsoft willingly decided to make additional physical RAM unusable even though since the days of MS-DOS the company has known how to address more memory than the number of bits in the system) WITHOUT a pagefile. No problems. Occasionally two separate instances of Firefox, MSN Messager, and a few other apps will hit the memory ceiling after which apps will just crash and disappear. The only reason I'm thinking of turning the pagefile back on is for Grand Theft Auto (memory hog and crippleware galore). –  PP. Jan 15 '10 at 17:43

I believe that if you don't have a pagefile, then in case of a BSOD, Windows won't be able to write the minidump. This means that you won't be able to analyze the problem by using the appropriate tools.

This might not bother you if you're not experiencing BSODs, and you can certainly recreate the pagefile quickly enough, but why not be prepared?

share|improve this answer
    
How true is this.. any supporting articles? –  Pacerier Mar 9 '13 at 13:35

The best reason I've found is that the pagefile allows Windows to use more physical RAM for the disk cache, which may be a better use for it than rarely used memory pages. Mark Russinovich has a great article on it, Pushing the Limits of Windows: Virtual Memory, which says:

Some feel having no paging file results in better performance, but in general, having a paging file means Windows can write pages on the modified list (which represent pages that aren’t being accessed actively but have not been saved to disk) out to the paging file, thus making that memory available for more useful purposes (processes or file cache). So while there may be some workloads that perform better with no paging file, in general having one will mean more usable memory being available to the system (never mind that Windows won’t be able to write kernel crash dumps without a paging file sized large enough to hold them).

share|improve this answer

I am running Windows XP with 4GB (3.5GB usable) of RAM. I need to run Visual Studio 2008, which requires a lot of memory. I often have 3 to 4 instances open, each taking up 500MB or more of memory.

I got really annoyed with this because whenever I needed to quickly close all Visual Studio instances, Windows would take forever to close the instances. It took 3 minutes or more. I realized what was happening was that the Visual Studio instances were paged out of RAM and into the pagefile, even if there was plenty of memory available. When closing the application, it would load all the paged data back into RAM, then shut it down. Essentially, it would copy 2GB of data from disk into memory before shutting down the instances.

After I disabled paging, I noticed a HUGE performance boost when shutting down multiple Visual Studio instances. It would take up 100% of the CPU for a few seconds, then disappear. Shutting down Windows is now possible well under a minute, rather than many minutes.

However, I did not notice any performance increase when starting applications, which makes sense, since the data still must be read from disk on startup. Also, I feel that things are generally snappier with paging disabled.

Also, I've only run into crashing programs due to insufficient memory only a few times a year. Usually if I open too many programs, or a program goes nuts and starts allocating memory like crazy.

In summary, I am very happy with paging disabled. Memory management in Windows is quite terrible. For those who are comfortable with tinkering with memory settings and are aware of the possible problems, I would recommend doing this.

share|improve this answer
    
This is the best answer for Visual Studio users, much better now without the paging file. –  79E09796 Oct 24 '13 at 15:43
    
I Do same for myself. put 8 GB of Ram in PC and disable the pagefile. Now my Windows use 3.5+ GB or RAM when I run VS but it's run fantastic :) –  Gupta Jul 19 at 12:49

If your ram maxes out one or more of the programs that requested the memory will likely crash abruptly.

That risk is going to outweigh any performance gains you may get.

share|improve this answer
    
That said, if you're as confident as your question suggests, there shouldn't be much problem. I also suspect not having a pagefile set will prevent you from hibernating. –  RJFalconer Aug 26 '09 at 23:55
    
That's fine - it won't max out. We're assuming here that I have enough RAM. By the way, I don't think Windows would crash with a blue screen unless there is so little RAM that the OS itself cannot fit in it. I've never actually seen that happen in practice, but yeah, I'd imagine if you tried to run XP on 16MB of RAM it might. –  EMP Aug 27 '09 at 5:42
    
yeah, you won't blue-screen, you'll just get an out of memory error of some kind. –  salmonmoose Sep 10 '09 at 2:54

My suggestions is to keep the page file, but manually fix it to a small size, like 128MB, on the system disk.

The reason is a practical one: windows really expects there to be a swap file, and will most often create a temporary auto-managed one if none is found, thus voiding any convenience in disabling it.

Also, it will silently fail or misbehave in some operations, like BSODing, performance counters, suspend/resume/hibernate, and somehow system stability suffers. All this based on my experience, and these all went away with a smallish pagefile.

Note that the swap file will most likely be filled in the first few minutes of execution, never to be touched again in most cases, so you won't suffer the usual disk access penalty swap file incurs. You MIGHT receive a "you're running out of memory" alert soon in your session, which you can safely ignore (yeah, swap is full, so what?)

(I also very much dislike superfetch, and rather leave memory free for caching effects)

share|improve this answer

Contrary to popular opinion, the pagefile is not simply a cheap but slow alternate to physical memory. It was designed to allow optimum usage of the RAM you have.

Even with 4GB of RAM you probably don't have nearly enough keep everything in memory. Nothing in Task Manager will reveal this. Knowing this, Windows designers created a system where executable code was only brought into memory when needed and then retained for as long as possible. If the system finds a better use for the memory thus used it will be reassigned. This system has been used by Microsoft since NT3.1, released in 1993. It has been in regular use in large systems since the 1960's.

This system works well for most forms of executable code. But modified data must be written somewhere, the pagefile, before the memory used can be reassigned. The pagefile is not normally used to to store code, only data. Being able to page out both code and data gives the system flexibility in what should paged out when necessary. Disabling the pagefile means that only memory used for code storage can be reassigned. All modified data, even that which has not been accessed for a long time and may not be needed again, must remain perpetually in RAM. But paging of code will continue as before. The lack of a pagefile, or having one that is too small, unbalances the system and forces Windows to page in a sub-optimal way. This usually impairs performance.

share|improve this answer
1  
Your first sentence sounded promising, but the rest of the answer ended up being the same old "you think you have enough RAM, but you don't" argument. I think what you're basically saying is that in determining how much RAM I need I haven't accounted for code, only for data. That's a valid point in general, but it doesn't answer this question. See the bit starting with if I have x MB physical RAM and y MB pagefile... Also, I don't understand how the lack of a pagefile can cause Windows to page. –  EMP Jul 23 '10 at 0:08
    
You just pointed ot that the the system has been used since 1993. Do you realize how much memory was available then compared to now? We're talking 2-4MB vs 2-4GB, that's a 1000x increase. At the same time, hard disks have not sped up 1000x. Therefore, paging 200MB from RAM to disk, then back, is REALLY EXPENSIVE! Paging 200KB is much cheaper in 1993 than paging 200MB now. –  Mas Jan 28 '11 at 13:47
    
@Mas: There are SSDs now, and enough memory to turn off paging (if you are sure you never fill it). –  Tom Wijsman Feb 2 '11 at 15:46

Pagefile

I run 32 bit XP with 4 GB memory (I know, XP only sees 3GB of that but it's interleaved and very fast) and would like to make two points:

XP can only see 3GB of memory. When my machine already has that, what's the point of a page file? It's reserving disk memory which it can never access. Unless it disables some RAM. So you've spent your hard-earned, on top dollar memory, only to find that XP is dating disk instead.

If you're running XP 32 bit and have 4GB memory, try this experiment: Turn pagefile off. Restart XP. Delete pagefile. Run a few progs, Word, Excel, Chrome, IE Ex, watch a movie, stream some music or TV. All should work well. Turn pagefile back on, this time with a really small size, say 25 MB. Restart XP. Run a few progs, Word, Excel, Chrome, IE Ex, watch a movie, stream some music or TV. You'll soon get a message that you are running out of virtual memory. This proves that XP uses the pagefile even when it doesn't need to. Check the task manager performance tab (alt ctrl del). Peak will be well below total physical memory, so why is XP using the pagefile? And why does XP think you're running out of memory?

The pagefile is an anachronism from the days of DOS and Windows 98. If you've got enough memory, get rid of it.

share|improve this answer
3  
Using a pagefile doesn't disable RAM at all. While apps may not use more than the amount of RAM (and most 32-bit apps aren't large address aware anyway), it allows Windows to cache things to disk. If you leave a process idle, that will be written to the pagefile to free more memory for the processes you're actually using. Sometimes the caching may be inappropriate, but that's the theory of it. I suggest you look up some tech docs on how pagefiles work and what exactly they do. –  ssube Sep 9 '10 at 4:22

Please think about SuperFetch loading your remaining memory with cache, it then becomes clear why we should not disable the page file. Serial tasks (as multi-tasking is bad) and cached application starts are really useful, so it's nice to have SuperFetch work at the cost of paging.

share|improve this answer
    
I don't want Windows deciding what I might need. I don't mind waiting a few seconds for something to load. What I hate is when I put an application out of focus for a while to do something else, and then bring that application back in focus, I have to wait for Windows to load the application from disk back into memory. This is very noticeable for applications that use up a lot of RAM. I found this behaviour improved in Windows 7 though. –  Mas Jan 28 '11 at 17:57
    
@Mas: This is normal behavior and would be indifferent if SuperFetch wasn't there. And you can decide to disable SuperFetch none-the-less, but that wouldn't make speed up loading inactive applications back into memory. If it is very noticeable, are you sure that your disk is still in a good state? –  Tom Wijsman Jan 28 '11 at 18:23
    
My point is, I would rather have my applications in memory ready to go, rather than having them swapped out for things Super-Fetch thinks I might need. As often run several instances of Visual Studio, it can take quite some time to for these instances to be loaded back into memory. –  Mas Feb 2 '11 at 15:08
    
@Mas: The behavior you are describing is not what I see on several computers, and SuperFetch doesn't do what you describe. As described in the Coding Horror article about SuperFetch "empty cache memory is wasted cache memory". Furthermore there is no need to run several instances of Visual Studio as you can have multiple files in multiple projects in one solution. If you are working on multiple solutions then you might want to consider to change the project hierarchy as that isn't the recommended way of working. –  Tom Wijsman Feb 2 '11 at 15:30
    
And back to the core basics of your work life: the Coding Horror article about The Multi-Tasking Myth. –  Tom Wijsman Feb 2 '11 at 15:34

protected by Diago Nov 24 '10 at 19:24

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.