41

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.
13
  • 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, 2009 at 23:49
  • 1
    @Molly You mean, YOUR link? :)
    – EMP
    Aug 27, 2009 at 0:31
  • 4
    @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
    Jan 28, 2011 at 18:01
  • 2
    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? Feb 12, 2011 at 21:14
  • 2
    Not subjective - please read the question carefully, particularly the assumption. I'm asking for specific reasons from reliable sources, not opinions.
    – EMP
    Feb 17, 2011 at 4:55

16 Answers 16

14

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.

6
  • I agree just leave it on.
    – user10547
    Sep 10, 2009 at 2:57
  • Can Windows even boot from a non-writable disk? Sep 10, 2009 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. ... Sep 14, 2009 at 10:19
  • 7
    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, 2010 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. Sep 9, 2010 at 2:35
8

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.

2
  • 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, 2009 at 3:02
  • 2
    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, 2009 at 5:14
8

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

4
  • 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, 2009 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, 2009 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, 2009 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, 2009 at 4:44
8

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.

4
  • 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. Aug 26, 2009 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, 2009 at 0:29
  • The link to Jeff's blog post seems to be broken.
    – Isaac
    Aug 28, 2017 at 15:59
  • 1
    @Isaac, fixed.. Aug 29, 2017 at 16:44
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?

1
  • How true is this.. any supporting articles?
    – Pacerier
    Mar 9, 2013 at 13:35
4

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

4

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.

2
  • 2
    This is the best answer for Visual Studio users, much better now without the paging file.
    – 79E09796
    Oct 24, 2013 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 :) Jul 19, 2014 at 12:49
2

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.

3
  • 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, 2010 at 0:08
  • 1
    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, 2011 at 13:47
  • @Mas: There are SSDs now, and enough memory to turn off paging (if you are sure you never fill it). Feb 2, 2011 at 15:46
1

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.

3
  • 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, 2009 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, 2009 at 5:42
  • yeah, you won't blue-screen, you'll just get an out of memory error of some kind. Sep 10, 2009 at 2:54
1

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)

1
  • "(I also very much dislike superfetch, and rather leave memory free for caching effects)" This makes little sense. SuperFetch IS a cache. Aug 1, 2015 at 1:10
1

One answer that was not mentioned was that Windows uses the page file to store crash dumps. The function that blue screens the computer writes the crash dump directly onto the sectors on disk that contains the page file (bypassing the file system driver that Windows, at the moment, can't trust).

Without a page file, you cannot get crash dump information. Also, the page file doesn't harm you if you don't use it, so outside of a very limited set of scenarios, there isn't a reason to turn it off.

0

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.

6
  • 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, 2011 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? Jan 28, 2011 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, 2011 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. Feb 2, 2011 at 15:30
  • And back to the core basics of your work life: the Coding Horror article about The Multi-Tasking Myth. Feb 2, 2011 at 15:34
0

If your question was:

Assuming that I have enough physical RAM for everything I do, and

  • I only ever do a small fixed set of tasks that are not locally intensive with file access

  • AND when all of those tasks are running simultaneously with the largest possible file/data they can run, along with Windows system processes, it fits in less RAM than is installed

  • AND the environment will only very occasionally have new or unexpected local files in it and the speed at which they are accessed is not a big deal

is there any reason I should not disable the pagefile?

and you said yes, then it would be OK.

Embedded environments are probably where this would have the highest chance of applying, like a cash register OS install.

0

The simple answer is windows become terrible if it runs out of memory.

Things become agonizingly slow.

Many software packages have memory leaks that slowly eat away at your available RAM.

Plus windows uses some of your RAM as a cache to your hard drives.

Unless you truly have way more RAM that you need it will eventually be a problem.

0

Basing on my personal experience, disabling windows pagefile may cause hidden issue.

I have 32GiB physical RAM, and disabled pagefile to avoid constantly writing to my SSD. Then my Battlefield 5 and Call of Duty 16: MW always crash after playing for 3-8 minutes. My game just randomly crash without any reason with pagefile disabled.

I thought there was an issue with my overclocked GPU, RAM or CPU. However, after debugging for 5 hours, the magic problem immediately disappears after creating a 512MB pagefile on my HDD.

I guess there's still some issue in Win10 memory management. Just providing my experience for your reference.

-1

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.

2
  • 4
    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, 2010 at 4:22
  • 1
    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. Sep 15, 2014 at 10:18

You must log in to answer this question.

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