Any reason not to disable the Windows pagefile given enough physical RAM?

27,448

Solution 1

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.

Solution 2

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:

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

Solution 3

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.

Solution 4

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.

Solution 5

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:
27,448

Related videos on Youtube

EMP
Author by

EMP

Updated on September 17, 2022

Comments

  • EMP
    EMP over 1 year

    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.
    • Admin
      Admin over 14 years
      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)
    • EMP
      EMP over 14 years
      @Molly You mean, YOUR link? :)
    • Admin
      Admin over 14 years
      well, i was recently referring to Mr. Posey's essay myself in a similar thread :)
    • Zifre
      Zifre almost 14 years
      Why does Windows pre-emptively write to the swap file? I can't see any reason why that would improve performance.
    • ssube
      ssube over 13 years
      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.
    • Mas
      Mas over 13 years
      @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.
    • Artem Loginov
      Artem Loginov over 13 years
      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?
    • EMP
      EMP about 13 years
      Not subjective - please read the question carefully, particularly the assumption. I'm asking for specific reasons from reliable sources, not opinions.
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 over 12 years
    • Kokizzu
      Kokizzu over 11 years
    • David Schwartz
      David Schwartz about 8 years
      @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
      David Schwartz about 8 years
      @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.
    • Jamie Hanrahan
      Jamie Hanrahan about 8 years
      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.
  • Lance Roberts
    Lance Roberts over 14 years
    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.
  • EMP
    EMP over 14 years
    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
    EMP over 14 years
    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.
  • salmonmoose
    salmonmoose over 14 years
    yeah, you won't blue-screen, you'll just get an out of memory error of some kind.
  • user10547
    user10547 over 14 years
    I agree just leave it on.
  • Victor
    Victor over 14 years
    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)
  • Admin
    Admin over 14 years
    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/…
  • salmonmoose
    salmonmoose over 14 years
    Can Windows even boot from a non-writable disk?
  • MDMarra
    MDMarra over 14 years
    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.
  • Admin
    Admin over 14 years
    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.
  • Victor
    Victor over 14 years
    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.
  • Christopher
    Christopher over 14 years
    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. ...
  • EMP
    EMP over 14 years
    I've read that answer (in fact it's linked in my question) and it was the very reason I posted this question.
  • PP.
    PP. over 14 years
    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.
  • EMP
    EMP almost 14 years
    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.
  • Sasha Chedygov
    Sasha Chedygov over 13 years
    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.
  • ssube
    ssube over 13 years
    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.
  • Mas
    Mas over 13 years
    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
    Mas over 13 years
    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.
  • Tamara Wijsman
    Tamara Wijsman over 13 years
    @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?
  • Mas
    Mas over 13 years
    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.
  • Tamara Wijsman
    Tamara Wijsman over 13 years
    @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.
  • Tamara Wijsman
    Tamara Wijsman over 13 years
    And back to the core basics of your work life: the Coding Horror article about The Multi-Tasking Myth.
  • Tamara Wijsman
    Tamara Wijsman over 13 years
    @Mas: There are SSDs now, and enough memory to turn off paging (if you are sure you never fill it).
  • 79E09796
    79E09796 over 10 years
    This is the best answer for Visual Studio users, much better now without the paging file.
  • Anirudha Gupta
    Anirudha Gupta almost 10 years
    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 :)
  • Jamie Hanrahan
    Jamie Hanrahan almost 10 years
    Getting rid of the pagefile does not prohibit Windows from removing processes from memory! It only does that for private, committed memory. Code and all other mapped files can still be paged out (or the RAM simply reused for something else, if the contents have not been changed since originally paged in).
  • Jamie Hanrahan
    Jamie Hanrahan over 9 years
    David Read: You are confusing virtual and physical addressing limits. Your 32-bit XP can most certainly address more than 4 GB of virtual address space. Only 4 GB per process, but you can have many many processes. Your analysis that "XP uses the pagefile even when it doesn't need to" is also flawed. Reality is that XP uses virtual addressing all the time, but that does not at all mean that it uses the pagefile all the time. The pagefile simply allows more virtual address space to exist at one time. If you don't have one, and you need it, programs will crash.
  • Jamie Hanrahan
    Jamie Hanrahan almost 9 years
    "(I also very much dislike superfetch, and rather leave memory free for caching effects)" This makes little sense. SuperFetch IS a cache.
  • Magic Mick
    Magic Mick over 8 years
    A reason "to" do it would simply be people requiring more space. I have a client server which I recently upgraded to 48GB RAM, I now am forced to increase the pagefile to compensate. This will obviously decrease space for applications, logs, exchange etc. This is ridiculous IMO because the 48GB which I just added is more than enough to run the server. Another reason, is the hammering the drives get from all the I/O, this may be seem like minor things, but in the long run they make a difference.
  • Isaac
    Isaac over 6 years
    The link to Jeff's blog post seems to be broken.
  • Lance Roberts
    Lance Roberts over 6 years
    @Isaac, fixed..