When memory goes bad in a system it can sometimes be difficult to diagnose. Here are some ways of testing your RAM's health.
Topher KesslerMacFixIt Editor
Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.
Tackling RAM problems in computers is not the easiest of tasks. While RAM is a relatively easy concept and simple to replace in the system, identifying problems with it can sometimes be daunting.
RAM is basically a huge grid where the system and active programs store active work space information (things they are currently doing). If part of a RAM chip is bad, the chip may still work fine until a specific application runs into the bad areas, and then that process will not be able to store items properly and will either hang or crash.
Unfortunately it is not that easy to distinguish a RAM problem from other potential sources for a crash, but some indicators include "Bad Access" or "Invalid Address" and "Kern Protection Failure" being mentioned in crash logs. Additionally, sometimes programs may cause the problem only when opening large files, or the problem may seem to happen more when you open several programs as opposed to any one in particular, or when opening programs in a particular sequence.
Regardless of how the symptoms manifest, there are some ways you can test RAM to see if it is working properly.
The quickest way to test RAM in a system is to methodically power through writing to it and reading from it, to see if any section of RAM is not performing as expected. There are a number of programs that can run such a routine for you, including the open-source Memtest command-line utility, along with its GUI version Rember. In addition you can use the Apple Hardware Tests that came with your computer (boot off the gray restore DVD with the D key held down to get to these diagnostics tests), and you can also use third-party utilities like TechTool Pro to run memory diagnostics.
When running these diagnostics, it helps to have as much memory free as possible; therefore, booting to a minimal environment works best. Restore DVDs or Safe Mode will help reduce the system's memory footprint, but the best method is to run the system in single-user mode (command-line only, so no GUI uses up extra RAM) and then run the Memtest program.
With Memtest installed on your system (in the default "/Applicatons/memtest" folder), boot to single-user mode by holding down the Command-S key when restarting. The system will drop you to the command prompt, where you will run the memtest command by typing the following command:
/Applications/memtest/memtest all NUMBER -1
In this command, "NUMBER" would be replaced by the number of runs you want to perform. Ideally you should run it between three and five times, but you can choose any number you'd like. The test will run continuously until it finishes the runs, or until you press Ctrl-C to end it.
If the program notifies you of an error, it should indicate which bank of RAM is showing the error, but if not then you at least know that your RAM is not working properly and can either replace it or have a technician further diagnose it if necessary.
If you suspect problems with your RAM, you can try swapping your RAM around in your machine. Most Macs have paired RAM in them, and one simple thing you can do is move the pairs to different slot sets on the motherboard (for Mac Pro users) or exchange the pairs within the same slot (which can be done for other Mac systems as well as the Mac Pro). By moving them around like this you might find a more compatible setup. Be sure to keep the RAM properly paired up according to your Mac's instructions. RAM can be touchy and sometimes having some modules being addressed before others may cause problems, especially if the modules are from different manufacturers.
You can also replace the RAM in your system, for example if you have a laptop or any other system that will hold only one pair of RAM modules. RAM is fairly cheap these days, and trying another module pair (even a smaller size than your current modules) may show promising results.
Keep in mind that RAM is very susceptible to damage from electrostatic shock, so if you decide to open your system and replace your RAM be certain to always properly ground yourself to your computer's chassis (touch it) and work in a static-free environment (a wood table is great).