In winxp, I have 4GB of RAM, am using 1.77GB, but programs keep paging out to memory. Why?

All in the title. What's the point of more RAM if my programs will page out instead of using it?

To be more specific, here's an example: I open 12 tabs in a browser. I look at one of them while using other programs for a few hours. My total RAM used never exceeds my physical memory. Yet, when I go through the other 11 tabs a few hours later, each one takes 30 seconds to load as my disk wildly thrashes. Why did windows clear the unused tabs from RAM instead of allocating new RAM for the programs I was using?

Granted I didn't really use those unopened tabs, but replace a few hours with 30 minutes and it gets annoying.


Solution 1:

The people at Microsoft have made certain decisions regarding this. It also has to do with Windows being optimized for short (3-6h) uptimes since the majority of users do not use it for longer than that. Linux, for example, uses up all memory and only pages when it is full - but even for this approach there are problems (how to decide what do discard when it does fill up, etc).

Rest assured the pros and cons have been pondered by MS' engineers, and it's not necessarily a bad decision.

Solution 2:

Your programs are using your memory. Windows doesn't only page out when it's out of memory. Read this answer on Server Fault for more information on how the pagefile in Windows works, it says it better than I can.

Solution 3:

One of the common "pagefile" myths is that it is there only for use when physical ram is full. This is not true. As you can see from the wikipedia entry, it is a topic of much more depth than most people seem to realize.

Solution 4:

This is a common complaint but it is based on a number of misconceptions about Windows memory management and exactly what Task Manager is telling us. In most cases Windows does a very good job of managing memory. But unfortunately Task Manager does not do a very good job of showing this. Part of the problem is that memory management is vastly more complex that most people imagine and follows principles that quite different that is popularly imagined.

Just a few specific things to remember:

  1. The memory gauge in Vista does not show full memory usage. Most of the upper portion of the gauge is actually in use. Similarly the memory shown as "Available" in XP is mostly in use.
  2. No version of Task Manager has ever shown actual pagefile usage. What is labeled as "PF Usage" in XP and "Pagefile" in Vista is actually the commit charge. Actual pagefile usage will typically be much lower.
  3. Much of the data that is in the pagefile is also in RAM.
  4. Paging is not exclusive to the pagefile. Typically only about 10% of all hard paging involves the pagefile. Nothing in Task Manager even hints at this.