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.

From my personal experience I've noticed that disabling the page file in Windows XP has given me, in general, the most speed gain out of any other software change I can make. Obviously this has to be done when a significant amount of RAM is available. Typically I find that it works nicely with +2GB of RAM. The only issues I've ever really had were loading up Adobe Photoshop.

Is this really a speed improvement or am I imagining it?

Note: In order to actually turn it off, you must not just set it to 0MB, but disable it. Otherwise Windows will just expand it when it needs to in order to meet its needs.

share|improve this question
7  
Attention: There is only a limited amount of memory given to drivers, called the non-paged and paged pool memory sections. A page file is necessary for when the paged section gets full, as a gamer I have seen a game complain about paged pool memory just because I had my page file disabled on a 8 GB system. Conclusion: Page files are necessary, they prevent paged pool depletion and actually do speed up your system. –  Tom Wijsman Oct 24 '11 at 16:21

10 Answers 10

up vote 17 down vote accepted

Windows XP flushes minimized applications to disk like crazy.. try it yourself, start downloading a large torrent and minimize everything. Pretty soon almost all of your RAM is used as file cache for the torrent instead of your other applications. Disabling the page file will prevent this behavior.

In Windows Vista and Windows 7 though, the system handles this scenario much, much better.. so I'm not sure disabling the page file in these versions will do much of a difference.

Some games require you to have a page file even when it's not really needed, I noticed this recently when trying to play a game demo I downloaded from Steam. Even though I had 6 gigs of RAM available the game refused to start until I created a tiny, tiny page file.. sigh

Personally, when I have plenty of RAM, I prefer to go without a paging file.

share|improve this answer
    
I've been going without a page file on WinXP since I asked this question and it's been great. I haven't really tried it on Win7 yet so I can't say whether or it would be worth it for newer versions of Windows. –  Joe Philllips Dec 15 '13 at 18:26

Don't mess with it, let Windows figure itself out.

This ServerFault answer is the most excellent explanation of why:

Many people seem to assume that Windows pushes data into the pagefile on demand. EG: something wants a lot of memory, and there is not enough RAM to fill the need, so Windows begins madly writing data from RAM to disk at this last minute, so that it can free up RAM for the new demands.

This is incorrect.

The punchline:

Removing pagefile entirely can cause more disk thrashing.

share|improve this answer
7  
How would removing the page file cause ANY disk thrashing? If anything it should stop thrashing. Windows will give an error if it runs out of RAM -- it's not going to decide to use swap if it's been disabled. –  Joe Philllips Jul 29 '09 at 2:11
2  
d03boy, read the SF post. If you have to move active process memory out of ram, it will cause a LOT more disk activity. –  Factor Mystic Jul 29 '09 at 2:18
3  
@d03boy: The answer is in the linked post. Basically, if you use too much RAM, the HD is going to be used in some way. If you remove the page file, the HD is still used to potentially store the program code (simply reading it from the original files on demand) when more RAM must be allocated. –  Sean Jul 29 '09 at 2:18
2  
This is not true for Windows XP though, Windows XP has horrible memory management. Read my answer. –  weazl Aug 11 '09 at 13:16
1  
@JoePhilllips: Removing the page file causes disk thrashing -- it reduces the options available to Windows to avoid thrashing. For example, Windows can write out pages of data that will never be read again to the page file to make more free physical memory, allowing it to avoid thrashing. With no page file, it doesn't have that option. Similarly, with no page file, Windows can only discard clean pages, so if the demand is highest for clean pages, clean pages will thrash because Windows can't move dirty pages out of the way. You can't make things fundamentally better by taking away options. –  David Schwartz Aug 26 '12 at 21:27

I would say enable.

No matter how much RAM you have, there will be scenarios when a page file is, at the very least, useful. Also, it should be noted that when there is a page file, much of the Windows runtime is offloaded there for most of the time. The reason? While it's needed in memory, it isn't needed at the moment. Putting it in the swap file may means it takes longer to access, but it leaves more RAM free for the programs you are actually using.

The reason your performance increased is because you were forcing the whole system to be loaded into RAM, which is admittedly much faster. However, my guess is that when you start using a bunch of programs at once, especially memory-heavy ones like Firefox and your Photoshop, that improvement will go right out the door.*

However, it is possible that you will never encounter that problem simply due to your computing habits. I know that if I tried to turn off the page file, I would not enjoy it one bit. So if you really want to, try leaving it off for a while and see what happens, you can always turn it back on again later.

*"That paragraph was a fair amount of speculation" /disclaimer ;)

share|improve this answer
    
I'm have 4GB of RAM now since I've recently upgraded (although winxp only sees about 3.5) and I've had the page file off for a few months without any issues at all and only one or two reboots. I do use fairly heavy programs (including photoshop) without any issues so far. –  Joe Philllips Jul 29 '09 at 2:18
    
In that case, feel free to ignore my advice and do what seems to be right for you. Although Factor Mystic's post has a much better argument for the same conclusion, so at least keep what he's saying in mind ;) –  Sean Jul 29 '09 at 2:21
    
Maybe I will turn it back on and see if it helps. I just can't imagine constantly writing to swap is good for my hard drive though. –  Joe Philllips Jul 29 '09 at 2:39

from microsoft answer "disable swap file"

http://social.answers.microsoft.com/Forums/en-US/w7performance/thread/0bd8a75c-2607-4468-8342-c35ea82ea670

Ken Blake, Microsoft MVP

is there any performance gain from that ?Thank you.

Can you? Yes. Should you? No, definitely not.

Is there any performance gain from doing that? No, and there's a possible performance loss.

First of all, 2GB is not a lot of RAM, it's the minimum amount that most people should have.

Second, if you don't have a page file, you can't use all the RAM you have. That's because Windows preallocates virtual memory in anticipation of a possible need for it, even though that allocated ay never be used. Without a page file, that allocation has to be made in real memory, thus tying up that memory and preventing it from being used for any purpose.

Third, there is never a benefit in not having a page file. If it isn't needed, it won't be used. Don't confuse allocated memory with used memory.

Ken Blake, Microsoft MVP (Windows Desktop Experience) since 2003 Ken Blake

share|improve this answer
    
What about thrashing? Is there less HD use if it's disabled? This doesn't seem like the entire answer. Not to mention, this question is about XP and this answer is about Win7 –  Joe Philllips Jan 20 '11 at 18:39
    
I don't think that MVP is correct, given sufficient memory you can disable the swap file; just make sure you don't run out of memory. –  Tom Wijsman Jan 23 '11 at 13:15
1  
@JoePhilllips - No, simply put, if Data memory+Program memory exceeds system memory with no page file then the space available for programs is reduced to make room for data, as programs can always be re-fetched from the original program files. So, if you have 8GB memory, 6GB of data & 4GB of applications, your OS only has 2GB to share between those 4GB of programs. It would be constantly reading in code & thrashing the disk. If only 4GB of data was actually needed and you had 2GB page file to swap the rest into, then the OS would be able to use the other 4GB for the programs, so no thrashing! –  Mark Booth Dec 9 '11 at 14:55

I would say enable but move it to a second drive, preferably one not in use by some other I/O hog. That has often given me better speed than disabling the pagefile entirely. Of course, maxing RAM is a good parallel optimization.

share|improve this answer
1  
If You do that, make sure You are moving the page file to another physical device. Moving it to another partition on the same device is a waste if time, unless You have an industrial-grade hard drive (like SCSI). –  Reef Apr 25 '12 at 20:06

I disable the swap file on 32-bit Windows systems with 4GB of physical memory. Having virtual memory on isn't going to add any more addresses to the system, and having it off means I never have to wait for Windows to swap in or out.

share|improve this answer
6  
What timing tests did you run, and under what sorts of loads? –  Michael Kohne Jul 29 '09 at 2:31
1  
No hard data == still subjective anecdote –  romandas Jul 29 '09 at 3:19
3  
Of course it's a subjective anecdote -- did I ever claim otherwise? I'm not sure why people are asking for timing data: I don't run servers on Windows (unless I have to!), I run my personal desktop and gaming machine on it. And for such a machine, subjective response is all that matters. –  kquinn Jul 29 '09 at 3:53
1  
And you never ran more than process as a time, I suppose? Even on a 32 bit system, more than 4GB of physical RAM can be allocated at any given time. You can even allocate more than 4GB of RAM to a single process by using the virtual memory APIs to remap sections of your address space. –  Eclipse Jun 29 '10 at 21:55
1  
Er, did you mean more than 4GB of Virtual RAM can be allocated? When all physical RAM is used up, you'll start to get paging errors from the MMU, which'll cause swapping. With no paging file, that's going to be swapping in of whatever DLL/EXE data got thrown out. With a paging file, it'd be whatever got written to the page file. –  JBRWilkinson Jul 1 '10 at 9:33

I disable the swap file on 32-bit Windows systems with 4GB of physical memory. Having virtual memory on isn't going to add any more addresses to the system, and having it off means I never have to wait for Windows to swap in or out.

No. Address space is as follows: every PROCESS has its own 31-bit address space (lower 2GB) and kernel has its own 31-bit address space (always same, regardless of which process owns current thread). This gives you 2GB * number of processes of available user-mode address space. Without a swap user-mode space is limited to physical memory size minus kernel memory size (usually around 200 MB). Of course, there may be some artificial limit on how much virtual memory your system can allocate, but I'm not an expert in Microsoft's licensing policies.

Also, note that disabling swap does not necessarily mean that there will be no page-faults resulting in disk access. The swap file is not the only file that memory is mapped to. Every executable file (that is, .exe or .dll, except kernel mode drivers) has its own disk backup - namely, the exe file. Of course, pages that have been modified in-memory, such as writable data segments, IAT, or even code segments (in case of packed executables, for example) need separate swap-backing, but vast majority of code/static data/resources do not need swap and... can be removed from memory when system is low on resources. When the process needs an access to such data, page fault and disk access will occur, whether swap is enabled or not.

share|improve this answer

There is never enough ram. Period.

I have a ridiculous 18 GIGS of DDR 3 1600 MHz ram installed on my machine, running win 7 64 on a quad core i7 920 overclocked to about 3 GHz, primary hard drive is the WD Velociraptor, which is probably the fastest physical HDD out there (aside from SSD, of course). This computer is so overpowered and completely overkill, its not even funny.

I disabled my swap file, and surprisingly I still found a way to crash the system. Even with 18 goddamn gigs of DDR 3 ram.

I was running the disk check utility, and as it ran, it caused explorer.exe to suck down more and more memory until it used all 18 gigs and crashed. Brilliant.

Some things ran a bit faster without the swap file, but overall it was not worth the trade off. I'll keep experimenting.

share|improve this answer

Sean Nyman previously said "especially memory-heavy ones like Firefox and your Photoshop, that improvement will go right out the door."

I just wanted to add that in Firefox, if you type about:config into the address bar to go to the advanced settings in Firefox, you can add a new string for "browser.cache.disk.enable" and set the bolean value to "false" and this will force Firefox to cache only to RAM. You can also add the string "browser.cache.disk.capacity" and specify a value to control how much space in RAM Firefox will use to cache in. Hope this helps. I have mine set to cache in RAM and Firefox is always super fast. I also have an SSD drive for the system drive in this laptop, with a 500GB rotary drive in the secondary bay for storage, and I set the TMP, TEMP, and Temporary Internet Files folders to point to the rotary drive in Win7 Pro, along with moving my pagefile.sys over to my rotary drive on D: and my system works very fast like lightning. I have 4GB RAM anyway, so I don't think Win7 even uses the pagefile much, but what is the harm in leaving in turned on?

share|improve this answer
    
No matter how much memory you have, windows likes to use the page file for some reason –  Joe Philllips Apr 16 '10 at 23:18

Disabling the swap file is perhaps the single most dramatic improvement you can use to increase the performance of your computer. In the typical scenario, most laptops use physical magnetic hard disks which have moving parts. These drives are very slow when compared to the speed of the memory in your computer. So if you have the ram to force windows to stay "within it's means" and never write out to the disk, it will only slow down when it has to hit the disk for a file not already in memory. Everything in memory will run significantly faster. The idea is to cache the entire operating system so it only reads or writes to a physical disk when it needs something not already in memory.

RAM read/writes happen in nanoseconds versus milliseconds on physical magnetic disks.

Now something to consider is that there are now new swap file options becoming practical. If you use a solid state disk or you get windows to put the swap file on a SD card, you will also experience significant performance increases.

Just my $0.02

share|improve this answer
3  
Disabling swap doesn't mean everything stay in memory. It means what gets flushed out of memory has to be read back in from it's original location on disk when it's needed. This means your system will be slower. See the SF post I link in my answer. –  Factor Mystic Jul 29 '09 at 2:21
2  
Which is precisely why you optimize it so it to never needs to hit the disk. I have done this before and it does work. –  Axxmasterr Jul 29 '09 at 17:31

protected by studiohack Apr 16 '11 at 23:19

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.