Problems from insufficient RAM and free hard disk space
If you have a limited amount of either RAM (memory) or available free or unused space on your Mac® OS X startup disk, you may encounter problems including kernel panics, the inability to burn CDs or DVDs, or the apparent loss of application preferences.
Memory management in Mac OS X
Applications and processing on your Mac require physical RAM to work. The more applications you launch or the larger the files those applications work upon, the more physical RAM is consumed.
To efficiently use your available RAM, Mac OS X employs a strategy common to all modern operation systems known as Virtual Memory (VM). For a detailed technical discussion of VM management in Mac OS X, see the "Memory Management in Mac OS X" chapter of the Apple® Developer Connection document Memory Usage Performance Guidelines.
Paging is a key activity of VM. Paging involves copying data between RAM and special files on your Mac OS X startup disk known as swap files. The use of swap files gives the appearance of the system having more RAM than is physically installed. Paging involves page-outs and page-ins:
The degree to which Mac OS X relies on VM depends on how much RAM you have installed and how much of that RAM is available, i.e. not currently in use. Paging increases with physical RAM use: the more RAM in use, the more paging may be employed as you launch applications or open documents.
Swap files are created and released dynamically and are saved in the /private/var/vm directory. However, the ability for Mac OS X to create a swap file depends on your Mac having free space on the Mac OS X startup disk.
Depending upon the load you are placing upon your system the number of applications running concurrently, the number and sizes of files each application is working upon, and other factors it is technically possible to exhaust both your Mac's physical RAM and the free space on the startup disk that is available for swap files.
Problems from lack of RAM or hard disk space
Problems arising from insufficient RAM or available hard disk space include:
These problems are even more likely to occur when the startup disk was nearly full to begin with, physical RAM is exhausted, and free disk space is consumed by swap files.
To avoid these problem, it is necessary to minimize the potential impact of page-outs by either increasing RAM, available space on the startup disk, or both.
Determining if your system is at risk
You determine if your system is at risk of experiencing the problems above by checking both the available space on your Mac OS X startup disk and how much paging your system is performing.
Determine the available space on your Mac OS X startup disk
Determine how much paging your system is performing
At then end of the PhysMem (Physical Memory) line, we see that the Mac in this example has 6 GB of RAM (3,970 MB used + 2,165 MB free = 6,135 MB = 6 GB).
Now note the pageins and pageouts in the last or VM (virtual memory) line:
125745(0) pageins, 0(0) pageouts
The numbers before the parentheses, 125745 and 0 in this example, indicate the total pageins and pageouts, respectively, performed since this Mac was last restarted. Over time, both numbers will increase. If the total pageouts is low ideally 0 compared to the number of pageins after having used your Mac for hours of work, you may have sufficient RAM. Otherwise, you should install more RAM.
The numbers within the parentheses are the most important: these indicate the number of pageins or pageouts performed in the last one second. If these values especially pageouts are consistently in the range of 25 to 50 or more, then the system is thrashing: paging excessively as it is starved for RAM at its current workload. Overall performance will slow as the CPU spends more time paging than on other work. If your Mac is thrashing, you need to install more RAM!
With 6 GB of RAM, there are 0(0) pageouts, both since the last restart and in the last one second. If this Mac had 2 GB of RAM instead of 6 GB, then the number of pageouts would be higher since the current physical RAM in use is 3.97 GB. Recall that RAM use increases with every additional open application or document. If this Mac had 2 GB of RAM and we opened many applications and documents, the number of pageouts, both total and on a per-second basis, would be significantly higher. Depending on the mix of open applications and documents, with just 2 GB of RAM, thrashing could result.
However, even with a large complement of RAM, such as the 6 GB in this example, pageouts and pageins can be high with very processor-intensive activities, such as video playback or compression. Therefore, the numbers in parentheses pages in or out per second are the most critical in determining when thrashing is occurring and if more RAM is critically required.
To quit the top application, press the Control-C keyboard shortcut in Terminal. To end the Terminal Session, press the Control-D keyboard shortcut, then Quit (Command-Q) Terminal.
Upgrade to permanently resolve the problems
The only permanent solution to avoiding these problems is to install any or all of the following, assuming your Mac will accept such:
To avoid these problems while considering your upgrade options: