Case of the Slow Mac II: The Memory Hog

By Aaron

no responses. »

It’s is often said that with Macs, things just work. But there are times when your Mac can sometimes work too hard for you. You can usually tell when that happens when your Mac become less snappy. In the first case of the slow Mac, the problem was a program that was using all of the processor resources, leaving a very unresponsive Mac Pro.

The second case was a little harder to track down as none of the programs were taking up much of the processor time, but applications and switching applications was taking  longer than normal, a lot longer. The problem was that some programs were taking up unusually large amounts of the system’s memory. To compensate, the system would “swap”, meaning the operating system would copy the contents of some programs in memory to the hard disk to make more memory available to active programs. The operation system would then swap the memory on the hard disk back when the inactive programs became active again.  The whole swapping process is slow and most modern systems try to avoid it.

It was a surprise to find my Mac Pro with 4Gb of RAM pausing while switching from iTunes to Mail, and then to Safari and VMWare. At first, VMWare looked like the culprit as a virtual machine uses up RAM. But VMWare wasn’t the problem. Activity Monitor revealed that a program called ‘mds’ was using large amounts of memory. mds is short for MetaData Server, it is the program that indexes all your files for Spotlight and other services to use. Somewhere along the lines of software updates or just prolonged use, Spotlight’s backend went from benign background process to monstrous memory hog.

The best way to deal with a memory hog is to kill it. There are several ways to do this, but I like to focus on the ones that don’t require opening Terminal and typing stuff. We’ll use a favorite program of mine called Lingon. Lingon allows you to edit your start up configuration files. When you start up Lingon you are greeted with this screen:

Lingon Startup

From the menu on the left, there are several places were start up files are located. The first one to tackle is Spotlight itself. You can find it under the item ‘System Agents’. Expanding that item reveals something like the following:

System Agents

Navigate to the item titled ‘com.apple.Spotlight and select it. You will be prompted with a warning that what you are about to do could mess things up.

Lingon Warning

But for me, Spotlight isn’t all that critical or useful (as I’ll explain later), so if you want to disable Spotlight, click OK and move on to the next step. Lingon will show you some of what is in the configuration file for starting Spotlight. In the upper right corner is a checkbox that says “Enabled”. Un-checking that box will tell OS X to ignore starting the program when the system is starting.

Spotlight

After you have unchecked the Enabled box, you will need to click the save button in order for your changes to take place. You will be prompted for an admin password and you’re done. The next step is to turn of the mds program. This one is found under the ‘System Daemons’ item under ‘System Agents’. It is named com.apple.metadata.mds. Follow the same process and uncheck the Enable box and save.

mds

The final step is to restart your Mac and you’re done. My Mac Pro is now snappy once again. But wait, you say, how do you get by without Spotlight? Don’t you ever search for stuff on your Mac? Luckily, Spotlight isn’t the only player when it comes to desktop searching. Spotlight primarily focuses on searches within your content (i.e. emails, PDFs, text etc.).  I find that I don’t search for what is in my files, I just plain search for them and then what to do with them once I’ve found them. There are some good applications that let you search for files (and other things) and act upon what you find. The one I use will be the subject of another post.

About Aaron

No comments. Be the first !

Leave a Reply

Site powered by Go Fish Digital