The concept of paging allows &os2; to give memory to applications even though no more physical memory is available. This is sometimes referred to as "virtual memory" (which should not be confused with the term "virtual address space" -- see &os2; Virtual Address Space for more on that).

If paging is enabled, &os2; will temporarily move data from physical RAM to a special swap file on a hard disk. The &os2; swap file is always called SWAPPER.DAT. Unless changed through &cfgsys;, this file resides in the \OS2\SYSTEM directory.

In detail, the following happens:

  1. If an &os2; application allocates memory and not enough physical memory is available, &os2; takes a chunk of the main memory (RAM) which has not been accessed for a while and writes it into SWAPPER.DAT. This part of memory is then available and given to the requesting application. As a result, applications may use more memory than what is physically installed in the computer.

  2. Now, if some application accesses the memory chunk that was swapped out, &os2; intercepts this memory access (because that "memory" now resides on the hard disk) and loads that region back into memory from the hard disk before the application actually accesses it. (If necessary, &os2; will have to swap another memory region to the swap file first to make room for the memory region which is to be loaded back into memory.)
Naturally, a hard disk is much slower than physical RAM, typically by a ratio of 1:100, depending on your processor speed and on whether that portion of memory has already been loaded into the processor memory caches.

This is why plenty of RAM is the most important prerequisite for an acceptably fast &os2; installation. Even though you may install &os2; with only 8 MB of RAM (&warp; 3 allegedly even with 4), you will then only hear the hard disk rattle because &os2; has to permanently swap in and out.

Even if you have a relatively large amount of RAM installed (say, 128 MB or more), &os2; may suddenly start swapping. Since growing the swap file is an expensive operation, you should choose your SWAPPATH settings carefully.

If you are using the &xcenter;, you can also use the "Sentinel" widget to monitor &os2;'s memory management.