How to Test RAM Under Mac OS X

Whenever I get a new stick of RAM for my Mac or PC, I’m always eager to just plug it in and start using it to its fullest, but having worked on hundreds of computers and encountering dozens of bad memory modules has convinced me that thorough testing is a must. While off-the-shelf PCs can run a copy of the free Ultimate Boot CD tool to perform RAM tests, Macs are a little bit more complicated in this respect. If you’ve purchased AppleCare for your Mac, it comes with a bootable TechTool Deluxe disc, but you’re otherwise left to your own devices when it comes to hardware tests.

Fortunately, with a little preparation right now, you can boot your Mac into Single User Mode and do a complete RAM test in the future. While you can run the necessary software in a fully-booted system, I recommend doing testing in Single User Mode where there are far less programs loaded in memory, and less chance of an important system component getting corrupted if your machine freezes or kernel panics — common symptoms of bad memory. A modified Mac OS X boot CD would be ideal, but that’s another post for another day!

Download Memtest

The testing setup isn’t terribly complex; I’ve taken the liberty of putting together an installable package which will put the Memtest utility into your /usr/bin/ folder. Memtest is a Unix command-line program that does the memory testing, and is the Mac equivalent of MemTest86.

Memtest Usage

To run memtest on a new memory module, first shut down your computer and install the new chip. (Some helpful guides for doing this can be found at iFixit, if you’re unsure of the exact steps.) Ensure the chip is firmly in place, close up your machine (or don’t, if you’re a pessimist), and power it on while holding down the Command and S keys to force Mac OS X to boot into Single User Mode. Once you see a black screen with white text, you can release the key combination. After all the system logging is done scrolling past, type memtest all 2 to test all memory two times. Two passes should be enough to detect any blatant problems, but I wouldn’t hesitate to let it run for hours on end if I suspected an intermittent memory problem (memtest all). When complete, you should be greeted with “All tests passed” if your new RAM is in good condition. If your system locks up or freezes indefinitely during the test, you may have a bad memory module on your hands.

2/16/12 Update: Memtest is still working under Mac OS X 10.7 Lion.

10/25/12 Update: Memtest is still working under OS X 10.8 Mountain Lion.

How to Test RAM Under Mac OS X

32 thoughts on “How to Test RAM Under Mac OS X

  1. For what it’s worth, I tried extracting the memtest binary from Rember, but apparently it’s too old (or something) to run under Leopard’s Single User Mode. It just sits there…


  2. Sparky says:

    I downloaded the installation package, however I cannot find the folders
    /user/bin and /user/share/man. I’m new to Macs. Can someone please walk me thru how to find them. Thanks so much in advance.


  3. grubstake says:

    It’s /usr/bin & /usr/share/man (no e like you had with /us[b]e[/b]r — I know it’s easy to confuse with the /Users folder)
    They aren’t normally visible in the finder you have to use the terminal app or single-user command line.


  4. Thanks for the article. I received a new 2.8 GHz Mac Pro (8-cores) four days ago. Since then, I’ve had it kernel panic twice and after much effort, managed to get it to panic again yesterday. Ram memtest86+ v2.01 (burnt the ISO to CD) and that kicked up a lot of errors. AHT ran fine on extended with no issues.

    Just running the version of memtest listed here in single-user mode; hopefully this is not a cpu issue…


  5. Grant says:

    Thank you very much for putting this solution together.

    Would you let me know what I am doing incorrectly?

    I have installed the package on my Power Mac G4 (dual 1.25 GHz, OS 10.4.11) and when I power up while holding down Command-S the machine simply boots up to the users log in page as normal).


  6. Jay says:

    When I ran the memory test on my macbook pro Early 2008 15″ model I got a Bit Flip : tok line. The memory I have attempted to test Is OWC 2x 2GB modules made by Micron pc-5300 667 mhz. Any insight into what this code could mean would be very helpful and appreciated. Thx


  7. bew says:

    Today I installed 2x2gb modules of DDR3 in a unibody 2.4ghz MacBook (not Pro) running OS X 10.5.6; I had a memory glitch while doing a 4gb file transfer over a wireless-n network, so I decided to run a test on the memory.

    I just ran this in single user mode in but it will only address and test 3.2gb of memory… it sees the memory page fie as “4096” and it tries to address 3.4gb, but gives an error saying that it’s too much for the program, splitting it into two 1.6gb test blocks. A “memtest all 2” came back alright, but I’m curious why it can’t test all of the memory on both modules.

    Any ideas?


  8. Bew – I have the same issue. I don’t recall whether memtest was originally developed for DOS/Windows or unix, but judging from the issue, I have a feeling it’s the former as Windows doesn’t see more than 3GB of RAM.


  9. Ben says:

    Bew & Matt: Most likely, the issue is that the MacBook has integrated video that needs to allocate 256MB of RAM for the display buffer. That area (and any other area of memory that’s allocated, like where the kernel and the memtest program itself are loaded) can’t be tested. But if your machine isn’t panicking and doesn’t have any display glitches, its probable that that allocated memory is OK.

    It’s advisable to try several different memory test procedures when you suspect a RAM issue for this reason.


  10. Williston says:

    Hi–Just ran across this while looking for information on memtest. I was just running it on a new “Nehalem” MacPro and I got worried that it might be getting too hot running memtest in Single User Mode. Does anyone know if heat can be a problem in Single User? I’m not sure if the fans will kick in normally.

    Thanks for any insight.


    1. @Williston I’m not sure about the newest machines, but if I recall from when I had a G5, in Single User Mode, the fans just ran full blast until the machine was booted back into full-on OS X (there’s probably some kind of environment monitoring kext or something that’s not loaded in SUM). Fans running full blast ought to be able to remove the heat generated by maxed-out CPUs, else you have a dud Mac Pro on your hands ;-)


  11. gogo says:

    Thanks for this tool! I found the page a bit late, and had already purchased 4.22 (which is running right now in single-user mode on the “bad” machine).

    Since upgrading to Leopard, my PowerMac G5 (Quad 2.5GHz) panics at random times. There doesn’t seem to be a pattern to what I’m doing when it happens. The “grey veil of death” seems to be a mystery. Once it even did a kernel dump right to the video memory. Never seen that before (or since).

    I first thought it was due to the Logitech drivers I was using for my wireless KB & Mouse, which ran fine under Tiger. Many Leopard users seem to have lots of problems with Logitech’s drivers under Leopard. But after uninstalling them, and switching to Mac KB & Mouse, it still panics.

    The first pass of memtest 4.22 came through without errors, and the second pass is underway.

    Assuming it (and the third one) also passes, what should I do?

    Maybe *I* should panic. :-)


  12. Nicole Hickman says:

    Is there any guidance for how to interpret the reports on the screen?

    I do get errors when running the utility in Single User mode, and it hangs as well, so I suppose both are indications of bad RAM, but I was wondering if there are any messages in particular I should be looking at to interpret what’s wrong?


  13. You don’t have to use the Terminal or some other über g33k method to see the contents of /usr/bin or any other folder on your hard drive. Simply, from the Finder:
    Go (menu) -> Go to Folder… [alternately, Shift-Command-G]
    which brings up a tiny window wherein you can type:
    and receive a Finder window with the directory (“folder”) showing the contents therein.


  14. Since I’m a big jerk, I have posted a copy of this GPL software at my web site after I paid for it. Sourceforge would host it for free. Hope it was worth the buck fifty, Scamaroni.


  15. David says:

    When I look at /usr/bin in Finder, I can see memtest, but when I boot into Single-User mode, most of the files that were in /usr/bin are not visible, including memtest. I tried ls -a, and I still don’t see anything. Why would all these files not be available?


  16. Thanks for the package. I am running memtest on my mac right now because I think that there might be some faulty hardware, I bought it second hand. I just hope it’s not the graphics card or the logic board! :L


  17. Hi,

    after running memtest all 2 I get the following error:

    Bit Flip : testing 168 of 256

    FAILURE! Data mismatch at local BUFA address 0x0196713c, BUFB address 0x238fedbc
    BUFA Data: 0xffefffff, BUFB Data: 0xffedffff

    Everything else passed except that. Do you know what could be causing that?


  18. G$M says:

    Ben replied saying…

    Bew & Matt: Most likely, the issue is that the MacBook has integrated video that needs to allocate 256MB of RAM for the display buffer. That area (and any other area of memory that’s allocated, like where the kernel and the memtest program itself are loaded) can’t be tested. But if your machine isn’t panicking and doesn’t have any display glitches, its probable that that allocated memory is OK.

    I have a question about this-
    My system does freeze up occasionaly – and I ran Memtest 1 and saw an error but I had forgoten to plug my laptop in so it died before the test completed.
    but when I run it again I don’t get an error.
    so is it possible that the postion of memory that is allocated to the display buffer or whatever else varies?
    is there a way to actually check it all?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s