Friday, 5 September 2008

Spotlight Goes Dotty

The last 3 times I have had a new install of OS X, I've noticed that it gets sluggish after a few weeks. Loading up the monitor app shows a process called mdworker being heavy on both CPU and memory.

My first reaction was that it was some sort of virus or at best a rogue app, but googling mdworker revealed that it was part of OS X. More precisely it is the Spotlight indexing daemon (keeps track of all your files to make searching faster).

My first reaction was to look for a way to turn off spotlight. I don't really use it very much and Quicksilver covers the needs I do have. However, Spotlight is also needed to search your mail, which I can't do without.

The problem appears when Spotlight is trying to keep up with a large number of new files on the system. In my case copying some music onto a new machine. The most straightforward solution is to tell Spotlight to ignore those files. This is easily done in System Preferences -> Spotlight -> Privacy -> Add ( + ). I added my Music directory which is where iTunes stores it's library.

It is odd that this should be a problem. Indexing is something that should happen in the background. There is no reason for it to affect the user. It appears that Apple decided that it was more important for files to be searchable than for the operating system to be responsive.