What's wrong with disabling the Windows page file?

People say that you always need a page file, and that it will increase performance, but my Windows 7 is set to run without a page file. I simply don't understand why people say this - I have 6 GiB of RAM, and the only time I even came close to running out of RAM was when I was compiling Chromium, for which I temporarily enabled a page file.

Do I really need a page file* for a speed boost in typical situations? Why?

*I'm aware that crash dumps need a page file. I don't ever use crash dumps, though, so that doesn't matter.


A pagefile will never increase performance, but it doesn't necessarily degrade it either (with proper memory management). Running without a pagefile, however, will only tend to increase your system's instability with respect to applications requesting memory that is not available for use.

Unless your OS is particularly bad at memory management, a pagefile with 6GiB of memory should see little use. That isn't to say it won't see any use at all; IIRC MS Windows is a bit crazy when it comes to paging things out even when there is plenty of memory available. (Why, I'll never know.)

However, what happens when you don't have the pagefile in use may be reason enough to enable it: hard crashes. Most apps expect to receive the memory they request. When they don't, they crash. (Ah, but the good-old-days of having to live in a few thousand bytes are gone..., and for all too many developers, so has the practice of dealing with memory management.)

If an app is built right, it'll fail nicely. (With luck, it'll not fail at all. But don't count on it.) With most apps, you'll have a fantastic failure on your hands. Furthermore, the more apps you have that come close to that limit, the more likely you are to see system-wide instability.

Case from my own experience. Windows XP, 4GiB, No page file. Perf was great. Until we started getting close to the 4GiB limit. Then things went nuts: apps would crash, menu items would only partially appear (or not at all), buttons would do nothing, etc. I switched back to the page file, even though performance was worse with it -- overall stability was simply better and more important.

Now, perhaps you don't use any apps or do work in your apps that would push 6GiB, but I can think of a few situations where you might get close: video editing, photography editing, audio mixing and production, etc. -- essentially anything where you are dealing with a lot of data (either working with, or streaming). When that data exceeds your memory capabilities, chances will be good that your app will just go "poof".


This article by Mark Russinovich will tell you everything you ever wanted to know about the page file.

I don't know if "cache" is the proper term to use with respect to what the page file does. A cache is a quickly-accessible temporary holding spot for data. An operating system "faults" things out to the page file when there is too much contention for physical RAM. So it's a stopgap for RAM overflow to prevent programs from crashing hard due to out of memory. But I do believe Windows tries to put things that haven't been accessed in a while in the page file (and Linux might do this too) so in that sense it is a cache, but not really its primary function.

Anyway, read the article. It will give you good guidelines on what to set your pagefile to. As @Sandeep Bansal says, there might be the occasional game that requires you to have one as part of a "requirements check" in order to run (but I don't know of any).

EDIT: This example can help you understand the role of the page file:

Let's say you have 512MB of RAM. You have a number of programs open, including a minimized browser itself consuming 250MB of RAM, and total RAM usage of everything running at that moment is 500MB.

So then, you start up another program (say a word processor) which wants to allocate 150MB of RAM. Out of memory. However, if we have a paging system, then the memory pages containing your minimized browser can be paged out to disk. So then the new program can load.

Now let's say you want to go back to the browser after a bit. Well, it needs to "page in" what it just sent to disk. If there's enough free RAM at that moment it can do that without a problem. If there isn't, something else has to be paged out first. If there's a lot of programs competing for the CPU and there is constant paging, then things get slow and you have the condition known as "thrashing." All this paging in and out causes slower performance, but it avoids programs from "hard" crashing due to out of memory errors. That is the purpose of the paging file. Too much paging, i.e. "thrashing" is likely no better than a program just giving up because it can't get any more RAM most of the time.

Now, you can see how if algorithms exist to anticipate what might not be being used at a given moment, then the operating system can "pre-page" things that it doesn't think will be used right away. So this accounts for Windows using the page file where it exists even if it does have enough RAM. It's trying to make as much RAM available as possible. Windows is like Linux where free RAM acts as a disk cache so if the balancing act is played right it can contribute to overall performance. This is all part of OS design and why it takes 10 years to get a good operating system out of thousands of programmers.

So, to actually answer your question as well, that is the only thing wrong with disabling the page file. Going back to the example I provided, without the page file you'd simply be unable to start your browser, or poorly written programs that aren't defensively programmed to anticipate OOM errors might act really strange.


A page file isn't just for crash dumps to be stored, it isn't essentially made for that.

The page file exists so it can store data that RAM doesn't need to hold, it's like a cache for items that don't need to exist in memory thus providing more RAM for other things.

You're right that you may not need a page file if you have 6GB RAM, but you may need a page file for certain items, I remember that a few games require a page file and also it can be useful if there is one.

There's no harm in creating a 500MB Page File just to avoid problems if a certain process needs it.


The first step is to understand what a Cache is, or rather, what the different caches are used for.
The CPU has a small internal cache which allows it to store OP results, flag states, and calculated addresses. On a dual core I believe that internal cache is about 1mb. It's is extremely fast, only accessible by the CPU internals, and the most affected by heat in an overclocked CPU.

The level 2 cache acts as a high speed buffer for CPU to Memory transactions and also holds code threads collected by prefetch. On a dual core I believe a tyical installation would have 6mb of lvl2 cache. It is very fast, though slower that internal cache memory, is accessible only to the memory controller and CPU, and resides on a dedicated line on the bus.

A page file is indeed a cache, in that it stores data which may or may not be present in memory. An O/S can use the paging file for various tasks, one of which is to save the current state of a data file that has not yet been committed to disk. When a pagefile does not exist, it is up to the third party application to provide this functionality internally. The trouble with this scenario is that many programs do not behave well when it comes to garbage collection, and you are left with spurious .temp files being left on your disk. These remnants are not part of the installation manifest and can hinder an uninstall procedure and also degrade disk access speed.

My opinion is that a swap file is normally a good thing to have. Indeed, if your system is highly populated with Ram and it is dedicated to 1 specific task, and that application takes care of all these things then a swap file may not be needed. One example may be an Arcade Video Game that runs on the windows platform, these are typically installed with only the drivers needed for the devices present and are not likely to suffer from driver contention. For the most part though, most applications do not take care of all the potential issues that could arise and especially those that include impact from other third party applications and driver contention.

Though you may notice a low to moderate decrease in performance in the shortterm of adding a pagefile, longterm the performance should remain consistent. Not having a pagefile may seem faster in the beginning, but over time performance will degrade considerably.

Steven Malm, MCP.