Juneteenth set to become federal holiday Loki's hidden detail in credits Ant-Man 3 Best early Prime Day deals 12 big Prime Day deals IRS child tax credit portal opens

Troubleshooting Tools: Memtest and Rember

Troubleshooting Tools: Memtest and Rember

Dan Frakes
May 2005

Our monthly Troubleshooting Tools column, penned by MacFixIt Contributing Editor Dan Frakes, covers products that can help you maintain -- and, if necessary, fix -- your Mac.


One of the most serious problems that can afflict your Mac is "bad memory" -- the common term for a defective RAM chip. Although the vast majority of RAM modules work perfectly, making RAM troubles a rare malady, it can be quite frustrating when you're one of the unlucky ones. At the worst, bad RAM can prevent your Mac from even starting up. But it can also be responsible for everything from application crashes to file corruption to seemingly random lock-ups and kernel panics.

The worst part of "bad" RAM is that it's common for people with such RAM installed in their computers to be completely unaware that the RAM may be the cause of problems. (Unfortunately, Mac OS X doesn't pop up a dialog saying, "Warning: One of your RAM modules appears to be defective.") For one thing, few people ever consider that their RAM may be defective. But even if you do suspect bad RAM, it's not always easy to pin it down as the cause of a problem. For example, if a defect on a RAM module is located near the "end" of the chip -- the last part of the module to be accessed -- you may not see any symptoms until Mac OS X is using a lot of RAM, which may be only after you've been using your Mac for a while. So reliably reproducing the problem -- the key to finding the cause of that problem -- can be nearly impossible.

    As a side note, reports of bad RAM tend to pop up much more frequently when Apple releases updates to Mac OS X. Over the past few years, it seems that after each new major version Mac OS X -- 10.2, 10.3, etc. -- and even after certain minor updates, a good number of people have found their computers unable to boot; removing one or more RAM upgrades allows the computer to boot normally. For whatever reason, it appears that certain versions of the Mac OS have less tolerance than others for RAM that is slightly out of spec (imperfect).

Confusing people even more is Apple's official policy towards RAM upgrades: Only Apple-provided RAM -- stock or purchased as an upgrade -- is "supported" for use in Macs. I call this policy confusing because on the one hand, it seems to imply that Apple's own RAM is infallible. Yet I've seen more than a few people who've had to have their Apple-provided RAM replaced because of problems. It also implies that third-party RAM isn't to be trusted, yet I personally buy all my RAM upgrades from reputable third-party vendors. As long as you buy correct-specification RAM, there's no reason it shouldn't work fine, and most such vendors offer lifetime warranties -- if you ever do have a problem, you get a replacement. (It should be pointed out that Apple gets its RAM from some of the same companies that supply RAM to third-party vendors, who often sell it for much lower prices.) My point here is that RAM is RAM, and contrary to what you may hear, buying from Apple is no guarantee that you'll never have a problem (or that your computer problems can't be due to bad RAM since all your RAM is from Apple).

All this is a way of saying that if you're having problems that you just can't seem to solve, you should consider the possibility that defective RAM is somehow contributing to the cause -- even if that RAM came from Apple.


How do you test RAM?

The above discussion begs the question, "How can I tell if my RAM is bad?" If the problem you're having is repeatable -- meaning you can predict when it will occur (at startup, when burning a CD or DVD, when you open a large file in iMovie or Photoshop, etc.) -- then the simplest way to test your RAM is to shut down your Mac, remove one of your RAM chips, then start your Mac up again and see if you can reproduce the problem. If you can't, there's a good chance the RAM chip you pulled out was the culprit. If you can reproduce the issue, chances are the pulled memory wasn't the cause. Assuming you've got more than one RAM chip installed, repeat the process, reinstalling the "tested" chip and then removing a different chip each time, until you've either found the bad module or eliminated "bad RAM" as the cause (in which case it's time to move on to other possible causes).

Unfortunately, if the only memory in your Mac is what came with it, and you don't have any spare RAM chips to swap with that memory, then you can't use the above testing method. It's also difficult to use this method if your problems are intermittent and unpredictable -- if you're experiencing kernel panics or system freezes that don't seem to correlate with any particular action or event, you can't determine if removing RAM or swapping it out fixes the problem. Or perhaps you've got a lot of installed RAM and you don't want to go to all the trouble of testing each chip separately. What you need is a way to test your RAM just as you would test your hard drive using Disk Utility or a third-party utility such as Alsoft's DiskWarrior.

Apple provides Apple Hardware Test with every new Mac -- it's either on the Mac OS X Install/Restore disc, or on a separate Hardware Test disc -- and Micromat's Tech Tool Pro also has a RAM test feature. However, for whatever reason, it's possible for bad RAM to pass these tests. Thankfully, there's a much better solution available, and it's free: the command-line utility Memtest, which is also available as a Mac OS X GUI application called Rember.

I'm not going to get into the nitty-gritty of how Memtest works; to put it simply, Memtest writes data to chunks of RAM, and then reads that data back from RAM to verify that it's the same. If it isn't, there's a problem. If it is, even after many, many testing cycles, it's a good bet that those chunks of RAM are good. By testing every chunk of a RAM chip in this manner, Memtest gets a pretty good idea if the chip is good or bad. (There are several ways a memory-testing utility can verify data saved to RAM; Memtest uses multiple methods in order to test thoroughly.)

Memtest has proven to be so good at what it does that I consider it a must-have troubleshooting utility -- one of the first things I do when I'm having serious problems with a computer is use Memtest to test the computer's installed RAM. I also recommend using Memtest whenever you add RAM to your Mac; after all, you may as well make sure your new RAM works properly before trusting it with your data, right?


Using Memtest

If you don't have much Unix experience, once you've downloaded and expanded the Memtest folder, you may be a bit intimidated -- it contains a number of Unix executable files. But don't fret; it's actually quite easy to use.

To install Memtest, simply drag the Memtest folder to your /Applications folder. (Unix gurus may prefer to install Memtest elsewhere; either approach is fine.) You can then run Memtest either when booted into Mac OS X or when booted into single-user mode. The former is easier; the latter allows Memtest to test more of your RAM. (Memtest can't test RAM currently being used by the OS or by applications.)

When booted in Mac OS X. To run Memtest when booted into Mac OS X, use the following steps:

  1. Quit all running applications -- this frees up RAM for Memtest to test.
  2. Launch Terminal (in /Applications/Utilities).
  3. Locate the file called memtest in the Memtest folder you downloaded; drag it into the Terminal window. (This will auto-type a command in the Terminal window that looks something like /Applications/memtest-4.05M/memtest.) Don't press return yet.
  4. Press the space bar, then type all 1. This should result in the following command, on a single line, in Terminal:

    /Applications/memtest-4.05M/memtest all 1

    (Note that 4.05M is part of the name of the Memtest folder, which may differ depending on the current version.)

  5. Press the Return key to start the test.

Terminal's output will show you the results of each test Memtest performs as it occurs. Once all tests have completed -- which can take quite a while if you have a lot of RAM -- you will hopefully see the message, "All tests passed." If not, you've got bad RAM. However, even if you get the "All tests passed" message, the developer of Memtest recommends running Memtest at least 3 or 4 times in order to ensure that your RAM is indeed problem-free.

Note that one problem with Memtest -- supposedly due to a quirk in Mac OS X -- is that it can only test 2GB of RAM at one time. If you've got more than 2GB of RAM installed on your Mac, you should run multiple instances of Memtest simultaneously, using the following instructions:

  1. Open two Terminal windows.
  2. In the first window, use steps 3 and 4, above, to enter the appropriate command in Terminal; however, instead of all 1, type 1999 1.
  3. Press the Return key to start the first instance of Memtest, which will test only the first 1999MB of RAM.
  4. Once you see the phrase memory locked successfully in the Terminal output, switch to the second Terminal window and use steps 3 and 4 above to enter the original command (all 1); then press the Return key. This tests the remaining RAM.

(If you have more than 4GB of RAM installed, you would repeat the 1999 1 Memtest command one additional time for each additional 2GB of RAM installed.)

When booted into single-user mode. The other way to run Memtest is in single-user mode. Doing so is similar to the instructions provided above, except that you have to type the path to the Memtest application manually:

  1. Make sure you know that path to the Memtest application.
  2. Restart your Mac, holding down Command S; this boots your computer into single-user mode.
  3. Type the path to the Memtest application followed by all 1 -- this will most likely be:

    /Applications/memtest-4.05M/memtest all 1

  4. Press the Return key to start the test.

Memtest will run just as it does in Terminal; however, a significant advantage of running Memtest in single-user mode is that because Mac OS X hasn't yet staked a claim to large amounts of your RAM, Memtest is able to test more of that RAM than when run in Terminal when booted in OS X. When Memtest has finished, assuming your RAM passes all the tests, type exit and then press the Return key to continue booting into Mac OS X.

(Note that if you've got a Power Mac G5, your Mac's fans are likely to turn on -- full blast -- while Memtest is doing its thing. This is normal, as the software that normally controls fan speeds on the Power Mac G5 based on temperature monitors inside the case isn't loaded in single-user mode; your Mac is simply playing it safe by turning all the fans on. Once you boot into OS X again, your fans will settle down.)

Since I can't cover every detail or scenario in this column, I highly recommend that you take a look at Memtest's documentation and FAQ before using it. But apart from the scary-to-some Terminal commands, it's actually quite easy to use.



I mentioned that Memtest is also available as a Mac OS X GUI application called Rember. Rember is basically a graphical user interface for the Memtest Unix command, created for people who have the heebie-jeebies about using Terminal. You simply launch it -- you don't need to download and install Memtest separately -- tell it how much RAM to test (e.g., All), how many times to test (I recommend 3 or 4), and then click the Test button. As with Memtest, I recommend that you first quit all applications; however, Rember makes this step easy by providing an option to quit all applications for you. It can even quit the Finder during the test; after the test is finished, the Finder will be relaunched. The results of your test(s) will appear in the Rember window's Log screen.

Although Rember is easier to use for most users, it has two limitations. The first is that it's at times a version or two behind the command-line utility. For example, the current version of Memtest is 4.0.5M, whereas the current version of Rember incorporates Memtest 4.0.4. [UPDATE The current version of Rember uses the latest version (4.05M) of Memtest.] The second limitation of Rember is that because it only runs when Mac OS X is fully loaded, it can't test as much of your Mac's RAM as Memtest can in single-user mode.


Final (RAM) Exam

Whichever tool you use, Memtest or Rember, I highly recommend using one of them. Use it whenever you get new RAM, just to be sure it's good, and use it when you're experiencing odd problems with your Mac that can't easily be explained or fixed by traditional methods (repairing your hard drive, deleting preference files, etc.).

Contributing Editor Dan Frakes is a former MacFixIt Editor, and is currently Senior Writer for Macworld and Reviews Editor for Playlist. To provide feedback on this column, or to suggest utilities for future columns, drop Dan an email at his @MacFixIt.com address: dfrakes.

  • Memtest
  • Rember
  • documentation
  • FAQ
  • Dan Frakes
  • More from Tutorials