My Macbook Pro came with 4GB of RAM in 2 2GB modules. In December, I ordered 8 GB (2 4GB modules) of RAM from Crucial so I could max out the RAM in the machine, as I intend to keep it for a while.

Early in January I started to see applications crash. VMWare Fusion became almost unusable. I had never seen this behavior from my Mac before, so figured the new RAM had something to do with it, but wanted to verify my assumption before blindly blaming Crucial for bad RAM. At that point I had to learn how to best test RAM on a Mac.

On a PC, I would have booted a CD running memtest86, but none of my Internet research indicated that was possible for the Mac.

Instead, I had to install memtest and boot the machine into single user mode in order to run memtest with the least amount of interference from running programs. I wanted to document what I had done in a blog post so I could remember next time.

Note: This article involves configuring your Mac in a way that could make it difficult for you to boot it normally if you don’t know what you’re doing. If you don’t feel comfortable following these instructions, take your Mac to a technician who not only feels comfortable fixing your computer, but is also competent to do so.

To tell the Mac to boot into verbose 64-bit single user mode, go to Applications/Utilities/Terminal, and type:

sudo nvram boot-args="-s arch=x86_64 -v"

You may be asked for the password you type to make changes to the system, type the password and hit enter.

Reboot your Mac.

Your Mac will boot to a prompt. You may be surprised at all of the text that goes by. These are kernel messages that are normally hidden by the nifty Apple logo.

At the prompt type:

memtest all

This will attempt to test as much RAM as it can. Remember that some of your RAM is being taken up by minimal amount of software that booted your machine into single user mode (the kernel and bash), so you won’t be able to test everything, but if the flaw was in the RAM being used by the software running at this point, the machine would have failed to boot.

If your RAM is good, the test will take hours and you will see something like:

hit CTRL-C and make sure you booted into 64-bit mode by typing the following:

uname -m

If the command doesn’t return x86_64 then you are not running in 64-bit mode and your Mac can’t reach the RAM above 4GB. Please reference the above command for booting your Mac into single user mode, as it includes the flags to set it to 64-bit mode, then reboot.

If the command above does return x86_64, then you are running in 64-bit mode and this message is probably a preview of test failures to come.

If you have more than one module of RAM, then take all of them out, and place one in the machine, boot, and run the test. After that one finishes test, note the results, turn the Mac off, take the RAM module out, and put the next one in. This way you can figure out which module is bad.

When done, make sure you have good RAM in the machine, boot it again, and type:

sudo nvram boot-args=""

This will give you your “normal” Apple logo screen on boot.

I hope you will find this article as useful as I will the next time we need to test RAM on a Mac.

Today, Crucial was nice enough to send me some new RAM after I sent them the bad module. So far, it appears to be passing memtest. Cross your fingers for me!

My machine is a Power Mac G4 1.42 Dual Processors MDD. It’s older. The PowerPC G4 processors are 32 bit. You can tell if it locks up by how it flips the text back and forth, testing/setting. If it keeps cycling between testing and setting, your good, but if it locks on to just one of them for like 5 minutes, it froze.

Perhaps it’s the motherboard. My brother-in-law lost his G4 more than two years ago because the motherboard gave it up.

Based on what I’ve read about memory problems, the inconsistent test results can be caused by bad voltage settings or bad timing settings. This makes sense because of the way RAM works, using capacitors to store bits, I could see how the wrong voltage settings might cause havoc.

I’m assuming no one has been modifying the voltage or timing settings for RAM on your Power Mac, so that leaves either the power brick or the motherboard as the culprits.

I know it’s not much of a comforting suggestion because the motherboard effectively is the computer.

When my brother-in-law took his G4 to the Apple store, they told him he needed to buy a new one. I hope I’m wrong in your case.

Back again with updated news! Lets start with the good news. It’s not the hard drive. I tried my old hard drive and it worked great for about 2 days and then it started hard freezing again. So I called a local mac tech and explained the situation and he said sounds like the bad ram, but could be the logic board.

So I decided to take my 512mb stick from the 1st slot and move it to the second slot. 4 days later computer is still working great. So the bad news is the logicboard is at fault. Slot (J21) will register memory, but something with that slot causes hard freeze issues. I found replacement boards on ebay for less than 20 bucks so there is hope. But I’m gonna try cleaning the slot first. What should I use? With machine unplugged of course!

Great blog, after following the instructions, I was able to fully test my new memory (upgraade my system from 4gb. to 8gb.). My new dilemma now though is it keeps on booting back to the terminal screen even after inputting the last command line given above? Although it does say to enter exit to boot the system, but after restarting it again, it still boots back to the terminal prompt.

That’s strange. I’m assuming it never gets to the graphical screen at all.

The -s is for single-user mode, meaning it boots into the terminal. It sounds like that’s still set.

Try running sudo nvram -p | grep boot-args to see what is set. If you see something like boot-args -s then you need to run the sudo nvram boot-args="" command (nothing, not even spaces, should be in between the quotes). That command effectively empties the boot-args firmware variable.

Any of you use “Rember”? It’s basically memtest with a pretty face, i.e. a GUI that you can run within OS X. I put 2x8GB sticks in my 17″ MBP (Late-2011), which supports 16GB, not just the 8GB that Apple would have you believe. I just wanted to make sure that the RAM was good, so I let it run through just 1GB, as I was already using around 8GB and still wanted to use the system.

So far so good, but I want to go all the way. How many “loops” do you suggest running the test through? Also, it’s got 9-9-9-25 timings. All other RAM in my previous 2011 Mac’s were 9-9-9-24. Do I care, do I worry, or do I install Win 7 x64, dedicate 8 gigs to it and run some sick game at high settings inside a virtual machine?

I wanted to test the RAM in an environment of lower entropy than a full GUI boot would produce. Rather than going through all of the system services and stopping them, I opted for single user mode instead.

In order to limit the possibility of the OS allocating RAM while I do the scan, I avoided tools like Rember. I didn’t want some other process to lock up the system before the memory scanner got to the bad spot in RAM. This way the memory scanner can report on which slot or module is bad.

I’m not saying Rember isn’t as good as memtest (it runs memtest under the GUI), just that a better test can be achieved in single user mode.

Thanks for this great tutorial. I was trying to get memtest86+ running form a USB-Stick and CD for hours without success. Then I managed to start it by using a Linux Live CD for booting. But as memtest86+ found thousands of errors, I did some research and found some hints in the internet that memtest86+ is not working correctly on Macbook Pros (mid 2010).

I was about to give up when I found your article. Finally I was able to install memtest on OS X and test the RAM in single user mode. It seems to be that the RAM is not faulty. Now I have to identify why my system is crashing so often. I will contact Apple Support.

Okay, so I’m running Memtest on a 2006 Mac Pro in Single User and 64bit. It has 20gb of RAM. Although it’s running in 64bit I still get the error:

“memtest attempting memory lock… error: memory lock failed”

What can I do to run through all the modules? If I take some modules out, don’t I have to leave a pair in at a time in a 2006? Also, I have 2gb modules and 4gb modules. If I have to run in pairs that = 8gb at the least for the 4gb modules (2×4). Is that too much for memtest?

I’m glad that it worked without the sudo, but I’m concerned that your sudo installation is broken.

sudo uses a file named /etc/sudoers to determine which users can run commands with administrative privileges. If that is missing and you didn’t delete it, then something might be wrong with your OSX installation.

The fact that the nvram worked without the sudo leads me to wonder if you are running as root all of the time, which is quite dangerous.

I’ve ran MEMTEST for hours and it’s just stuck on “Test sequence 1 of 1: ”

i’m using a macbook pro i7 8gb ram, however, the performance is VERY sluggish, I can type two or three lines before the word shows up. Checked my hard disk and it’s completely OK. (compared the hdd test with my friend who’s on a lower spec and my results are way better than his).

Can you suggest anything that I can do? Seeing that memtest is kinda stuck, can I safely assume that my macbook is running slow due to bad RAM?

If it gets stuck on the MEMTEST, then I’d say it’s highly probable that you’ve got bad RAM, or the motherboard is having issues.

If you have more than one stick, try MEMTEST on the sticks one by one. If you have one stick, try buying another one (you can likely return it if you find out that’s not the problem).

Also, you are running this in single-user mode, without the GUI running, right? Single-user mode reduces the number of processes that are running in the background. If you’re not running the MEMTEST in single-user mode, then a runaway process may be making your Mac sluggish. An i7 MBP with 8GB of RAM should not be sluggish.

Hi, Im having a late 2011 mac pro 13″ i5 with 8 gb ram installed and running mountain lion on it, lately i’ve been facing problems such as it boots up to an grey screen with three beeps, then when you try to boot it up again after two or three attempts it boots up fine and workes fine without any problem untill the next time i boot it up after a few hours. Now i followed your instructions for the memtest, but at the prompt when i enter memtest all it returns saying the the command does not exist, iv’e tried uname -m just to make sure it runs in 64 and it returns x86_64. Can you suggest what might be the problem, please…

Hi, Sorry for the trouble, i realised it later after i posted it,Anyways i managed to install it and checked both my memory sticks Individually as well as together, both the time it passed all the tests, but still whin i turn on my laptop after its been shutdown for quite some time it starts giving the three beeps at start up and wont boot, then you just remove the ram and put it back again and it works fine, then i tested it with just 1 slot populated and it works fine with both the ram cards, then i populated both the slots with the original ram that came with the laptop and it works fine with out any problem. Now im confused both my 4gb rams works fine individually both my slots on the mother board work fine, bu somehow both the 4gb ram together dosent seem to work whereas they used to work without any problems before. Any sugestions.

I have MacBook Pro 15 inch 2011 with 4 gb of RAM. My Mac crashes often after I quit a game like minecraft. After a start up it beeps 3 times with a pause and then 3 beeps again. I think it’s something with the RAM but I when I run memetest it doesn’t come up with anything and I also tried apple hardware test and no trouble found either. I have a windows partition on my Mac and it runs smoothly, no crashes even playing games like minecraft and just cause 2. If it is a RAM problem how come it only affects my Mac partition?

It is possible, however unlikely, that you might have a RAM problem in the area that doesn’t get tested by the app (there is generally a small portion that doesn’t get tested). If you are comfortable opening up your MBPro, try swapping the sodimms (put the lower one on the top slot and vice versa). Of course, use static electricity and other usual precautions when handling the memory cards. Of course, that is assuming you have 2x2GB sodimms and not just one 4GB stick.

I have found in a couple of cases that this has led to errors being found. Might be worth a try.