The first of these is Apple's built-in hardware tests suite, which can be accessed by holding the D key down while you restart your Mac. Doing this will load the diagnostics suite. Older systems, this classic utility has a blue interface with information about your Mac and a big Test button. To use it to test your RAM, check the box for the extended memory test (this will run multiple passes and different patterns to the memory), and then click the Test button.
On newer Macs, the tests run automatically when the utility is invoked; it appears with a gray background instead of blue.
Note that, if you have formatted your hard drive and reinstalled OS X, then the built-in hardware tests may have been wiped; however, you can still load them from the Internet by holding the Option-D key combination (as opposed to just D) at startup when you hear the boot chimes.
If the hardware test finds any faulty memory, it will list the faulty memory addresses. If everything is OK, you'll see a message that states all tests passed and no problems were found.
In addition to Apple's testing suite, there are plenty of third-party memory-testing utilities. One of the most popular is the free memtest, which is run from the Terminal command-line. You can also get a graphical wrapper for memtest, called Rember. But, as I say, there are many of them; just check the Mac App Store and search for RAM. Each will test memory differently and some may miss a problem that another can detect. Therefore, I recommend you use more than one.
For best results, you should run these RAM-testers under some special conditions:
Run in Safe Mode or Single User Mode: Since memory test programs can only test the RAM that is available, be sure to run it in as minimal of an operating system as possible. This means, if you use Rember or memtest, to do it in Safe Mode (for anything requiring a graphic interface), or better yet, in Single User mode, as these will ensure as much RAM is available for testing as possible. That's why Apple's Hardware Test is a great option: it loads only a rudimentary operating system, which loads just the tests, ensuring that RAM isn't occupied with anything else.
Swap or rearrange RAM chips: If you have access to the RAM chips on your system, swap or rearrange them, especially if you have more than two available RAM slots (as you do on some iMac models and the Mac Pro), and then test again. This will help ensure that all RAM addresses are accessible to the testing program, because the system will load core OS components into different parts of RAM.
Sign up for CIO Asia eNewsletters.