Follow The Safe Mac on Twitter to stay advised of the latest Mac security news!
Mac Performance Guide
Published July 14th, 2012 at 4:38 PM EDT, modified May 20th, 2013 at 10:26 PM EDT
Although they don’t need regular maintenance to keep them performing at their best, Macs, like any computer, can sometimes suffer from a variety of performance issues. When you start to see the spinning “beach ball” cursor and general slowness, there is something wrong somewhere. The question is, where? The goal of this guide is to help you find the source of the problem and fix it.
One thing that is important to understand is that performance problems may be completely normal for what you are trying to do. For example, if problems occur immediately after upgrading to a new system on an old machine (eg, Mac OS X 10.6.x to 10.7.x), there may be nothing wrong. Your hardware may simply be inadequate for the demands being placed upon it. Similarly, if you’re having performance problems with a specific app, especially a game, you simply may be asking too much of aging or inadequate hardware.
In addition, there are a number of myths circulating about important maintenance steps that are needed to keep a Mac running fast. Some of these myths are outlined in The myth of the dirty Mac.
All that said, let’s start looking at possible reasons for performance problems.
- Free hard drive space
- Repair the hard drive
- Check the RAM
- Check for CPU hogs
- Check the hardware
- Check third-party software
- Clear caches
Free hard drive space
In Mac OS X, keeping some hard drive space free is a requirement. The system needs free space for writing virtual memory swap files, log files, Time Machine’s local snapshots, Versions data and many other things. Without adequate free space on the drive the system is installed on (the “boot drive”), the system can become slow or even start crashing, ultimately leading to data loss in the worst case scenario.
The question is, how much free space is enough? This has been a question of some debate among experts, but in the end, that debate is fairly academic. If you have slightly more free space than needs to be free, that’s not going to hurt you. A reasonable rule of thumb is that about 10% of your hard drive’s total capacity should be free. In other words, if the boot drive is 500 GB, you need to keep approximately 50 GB free. If your hard drive is below that 10%, you need to delete some files until you have 10% free. If you don’t know how to tell how much free space there is, choose Computer from the Go menu in the Finder, select your hard drive and choose File -> Get Info. Compare the Capacity and Available numbers. If Available is more than 10% of Capacity, inadequate free space is not the cause of your problems.
What do you delete? That’s a good question, and there’s no easy answer. Some people will recommend using a variety of “cleaning” tools to remove logs, caches, etc. It’s important to understand that this is not a good plan, though. The gains will be small and temporary. Similarly, some will recommend doing things like deleting preinstalled apps, removing unused languages from apps, etc. Again, this will not be a significant gain, and worse, it can cause other problems down the road. It’s better not to do that kind of thing.
What you need to delete is your files – in other words, files that are in your user folder. Clean out your Downloads folder, for example, and make sure to empty the trash afterwards. Movies, photos and music are some of the largest files, so if you can remove some of those, that would be ideal. Note that you can move some of those files to an external hard drive or network storage rather than deleting them entirely. If you’re having trouble finding some of the largest files, get a copy of OmniDiskSweeper or GrandPerspective (both are free) to help you see where the largest files are.
Just follow one cardinal rule: if you don’t know what something is, don’t delete it! For more information on this topic, see Where did my Disk Space go?
If you just absolutely cannot delete enough files, and you also cannot move files to an external drive (for example, because you have a laptop and need those files to remain easily portable), then you could replace the internal hard drive with a larger one. Before embarking on such a procedure, you would need to make a good set of backups. Then, after installing the new drive (or having someone else install it), you can restore a backup to the new drive. (You can also put the old drive in an external enclosure and use it for other storage, including an additional backup.) Note that you will want to pay close attention to the speed of the new drive. If you replace a faster drive with a larger, but slower, drive, your performance will suffer for other reasons.
Repair the hard drive
Sometimes, the hard drive’s directory structures can become damaged. When this happens, many problems can result, including performance problems. Fortunately, ruling this out is very simple: just repair the hard drive with Disk Utility.
Unfortunately, sometimes hard drive problems can be more extensive. If your hard drive cannot be repaired, you will probably want to simply erase it and reinstall your system from scratch, or restore from a previous backup. If that fails, or if it succeeds but the hard drive problems come back very quickly, your hard drive may be failing and will need to be replaced.
If you don’t have backups and the drive can’t be repaired, you can try repairing it with DiskWarrior. However, if the drive is too badly corrupt or is failing, you may learn the hard way why backups are so important!
Check the RAM
Performance problems can be the result of inadequate RAM for the tasks being done. In addition, newer versions of the system or an individual app may require more RAM for the same tasks than older versions. For example, when I upgraded to Lion (Mac OS X 10.7) from Snow Leopard (Mac OS X 10.6), I saw a lot of spinning beach balls. Ultimately, I determined that the 4 GB of RAM that was more than adequate for my needs in Snow Leopard wasn’t quite cutting it in Lion, due to some changes in Lion’s memory management (namely, the transition to an entirely 64-bit system). After upgrading to 8 GB of RAM, the beach balls became a thing of the past.
Now, I’m not recommending that you go out and spend money on RAM just to see if that solves your problem! Instead, open Activity Monitor (found in the Utilities folder that is inside the Applications folder) and select the System Memory tab, then compare the page ins and page outs. If the page outs value is too high – more than 10% of the page ins value – then that is an indication that you could benefit from more RAM. If it isn’t that high, adding more RAM won’t help. Note that you should not try to look at these values right after startup, as page outs will generally be zero, or close to it, soon after startup. Wait until your performance problems start happening, then check the page outs!
If you need more RAM, you can take your machine to an Apple Store and have the techs there install more. That’s a bit pricey, though, compared to other options. Instead, you could buy RAM from somewhere like Crucial or Other World Computing and install it yourself. You will need to be sure to do your research first, though, and get the correct RAM for your machine. You can also look in the manual for your Mac for installation instructions.
Check for CPU hogs
Another thing to check for is programs that are hogging the processor (CPU). In Activity Monitor (found in the Utilities folder that is inside the Applications folder), click the “% CPU” heading in the list of running processes. This will sort the process list by the amount of CPU time being used. If it sorts the zeros at the top of the list, click the “% CPU” heading once more to reverse the sort. Look at the top few processes.
In normal usage, with no major processing going on in the background, I have never seen this number go above about 10% for any individual process. Of course, if you’re doing something like applying a complex filter in Photoshop, rebuilding the index of a very large mailbox in Mail, playing a Flash-based game in Safari or something else along these lines, I would expect to see those apps’ CPU usage go much higher than that. But otherwise, if the machine should be mostly idle, a high number can point you to the source of the error. If some third-party software is hogging the CPU for no good reason, the fix may be as simple as uninstalling that application. If it’s some system component, the fix will be more complex. Keep trying some of the other tips in this list, and hopefully one of those fixes will help.
Check the hardware
Bad hardware can also cause performance issues. Sometimes the cause of a hardware problem can be obvious. If you’re having performance problems after spilling a liquid on your computer, dropping it or installing new RAM, for example, checking the hardware may seem obvious. However, sometimes more subtle hardware issues can be present yet remain unnoticed until some system update happens to “trip” over the problem. So it can’t hurt to check the hardware, using Apple Hardware Test. Keep in mind, though, that AHT cannot find all possible hardware errors, so a “pass” from AHT is not a guarantee that your hardware is fine. If problems persist, and no other troubleshooting steps work, it wouldn’t be a bad idea to call in Apple’s techs for some more in-depth testing.
Check third-party software
Many people unknowingly install what many experts irreverently refer to as “crapware.” Such software serves no important purpose while potentially causing problems, including performance issues. When having problems, an important test is to start up in Safe Mode by holding down the shift key at startup. This disables all third-party software that loads at startup, among other things. If the problem goes away in Safe Mode, but reappears when you reboot normally (ie, without holding down any keys), the problem is almost certainly third-party software.
If this is the case for you, the first thing to do is examine your login items. Go to System Preferences -> Users & Groups (or Accounts on older systems) and examine the items in the Login Items list. Remove some of those items and restart the computer. If the problem persists, remove some more. If the problem goes away, you’ll know you removed the cause. To be able to add those items back to the list later if you want to, you should control-click (or right-click) on each item and choose Show in Finder, then make a note of the location. (You can control-click the folder name in the title bar of the Finder window to see the path to the file.)
If the login items are not the problem, there are a couple other things that can keep software running in the background: LaunchAgents and LaunchDaemons. You can find the former by choosing Go to Folder from the Finder’s Go menu and entering the following path:
Try removing anything from that folder temporarily, then restarting the computer (or just log out and then log back in). If that helps, one or more of those LaunchAgents were causing the problem. You can continue troubleshooting to narrow it down if you like.
If that doesn’t help, try looking at the LaunchDaemons. Again, in the Finder, choose Go -> Go to Folder, and this time enter the following path:
Again, try moving everything out of that folder temporarily, then restart the computer.
Finally, if all else fails, try pasting the following command into the Terminal (found in the Utilities folder that is in the Applications folder):
kextstat | grep -v com.apple
After pasting that command, press return to execute it. This will list all third-party kernel extensions (kexts) that you have installed. Mine shows:
This shows that I have a number of Parallels kexts installed. If I were having problems and got to this point in troubleshooting, one thing I would try would be uninstalling Parallels. You can tell what app a kext belongs to because the name will be like a reversed domain name. For example, com.parallels.kext means the kext was installed by software from parallels.com. You’ll want to remove software that installed these kexts one at a time, using the provided uninstaller (just dragging the app to the trash will leave the kexts in place), restarting the machine and testing the performance after each uninstall. If the problem disappears, you’ll know the one you just removed was causing the problem, and you should be able to reinstall any others that you had removed.
Cleaning caches is not something I recommend doing lightly. This has become a rather popular, but completely unnecessary, task to perform as regular maintenance in Mac mythology. Clearing the caches actually can slow down your computer in the short term, as the purpose of caches is to keep things going fast. So you shouldn’t clear caches on a regular basis to keep your machine running fast. However, caches can become corrupt, so it may be appropriate when having problems to clear the caches.
There are a number of utilities that can help you do this, some good and some to be avoided. To be safe, I recommend simply doing the job yourself. You can safely delete everything in the following folders:
The first of those is found in the user Library folder (which is invisible in Mac OS X 10.7), while the second is found at the root level of the hard drive. If that’s Greek to you, just choose Go -> Go to Folder in the Finder and paste in the first path, then hit return. Delete everything inside that folder. Then repeat with the second folder. Once you’re done, restart the computer.
If this is too intimidating to try to do manually, download OnyX and use it to clear the caches, but don’t be tempted to use it, or any similar tool, for regular “maintenance,” which is completely unnecessary. (See The myth of the dirty Mac.)