Stress testing your Mac is a useful way to work out if it is performing to its best and to determine if there are any faults within the various components. Stress testing your Mac is also a useful way to determine if you Mac has a fault if it is using 100% of a CPU, or if there is bad memory. Today’s post is going to describe three ways to stress test the core components of your Mac, CPU, RAM and disk. By testing each one to the ‘max’ you can determine if there is a problem and if you Mac can handle the heat.
Stress Testing The CPU
Stress testing your CPU is probably the simplest of the three core components of your Mac. To test your CPU to the max, open Terminal located in your Applications > Utilities folder.
We are going to use the ‘yes’ command to test the CPU. This command prints out the letter ‘y’ as fast as possible. The result of this means it uses 100% of a CPU core. To use this command type the following and hit enter.
yes > /dev/null
This executes this yes command. It then pipes this data to /dev/null/ . This means we don’t see any output. If you want to see the output of a million ‘y’ characters on screen remove the ‘> /dev/null’ reference.
You will notice in your activity monitor that one CPU will shoot up to 100%. Putting load onto your system. If you have more than one core, open a new terminal window and type the command again. Repeat for as many cores that you have on your Mac. Not that due to the use of hyper-threading you may need to use more than the number of physical cores on your Mac to fully load the system . To find out how many physical cores your Mac has got to the hardware report section of System Information / About this mac.
To stop the test use Control + C to kill the command. Alternatively you can close the Terminal window. This will load your system and is a good representation of a fully loaded system.
Stress Testing Your RAM
RAM is a little bit harder to test. Instead of pure speed we need to look to see if there is any problems with the chips. To stress test your RAM we are going to use memtest (direct link to the package here). Install the package and open up Terminal.
With Terminal open type the following to test your RAM.
memtest all 1
This will test every byte of RAM your Mac has access to once. If you want to continue testing your RAM indefinitely use the following command:
If you want to test a small portion of your RAM you can use the command:
memtest 100 1
This will test 100mb of RAM once.
The test will loop through your Mac testing it for a variety of problems.
You will notice that memtest will only test a small subset of free memory available to you. You could close every program on your Mac, but this still won’t test every byte of RAM. To test it all you will have to boot into single user mode. Restart your Mac and as it reboots hold Command + S. Once it has finished booting you will see a black screen with white text. Type
memtest all 2 to test every bit of available RAM. Restart to get back to norma.
Stress Testing Your Hard Disk Drive
The final core component of your Mac is the hard disk drive. The crucial component that holds all of your data. Over time these degrade and slow down. To stress test your hard disk drive for speed and performance we can use a tool called Blackmagic Disk Speed Test free from the app store. When you load the app select the disk drive you want to test. Then select the size of file you want to write. I recommend the largest of 5GB.
Hit the start button and it will test the read and write performance your your disk drive. It will keep doing this until you tell it to stop. Note, if you get an error saying it cannot write to the disk, select your user folder or something similar. Sometimes selecting the root of a drive causes an unwritable error message.
You can save the result of the disk speed for later use. My SSD drive has only slowed by a couple of tenths of a megabyte over the last year. Its a good way to see if your Mac can handle the disk speed read/write load.
Bench Marking App
All of these separate tests are useful, as well as free. However, if you want some more concrete numbers and a more repeatable test I recommend you download and buy Geekbench from the App Store.
This app tests your CPU and RAM in a more controlled way. At the end it gives you a score which you can save and compare later. I recommend you close down every app since the final score can be heavily influenced by what apps are running.
There are many ways to stress test your Mac. Most of the methods are free and give you good results. It is always interesting to see how your Mac shapes up over time.
Stress testing can also be a good insight into any possible failures. Especially with testing using memtest, if there is a fault on your RAM chips, it will find it.