I want to tell you about how I tracked down, identified and ultimately eradicated a mysterious bug for which there seemed no immediately obvious cause.
The mystery actually began a few weeks ago, when I updated my Mac Pro from Snow Leopard to Lion (OS X 10.7.2). I had previously upgraded the other two Macs in our house without incident. So I was expecting similar smooth sailing. And, at first, my expectations were met. Lion installed successfully and everything was working perfectly.
It took a few hours before trouble arrived. My Mac began slowing down. I mean really slowing down. At first, it was just a slight lag. But, soon thereafter, everything slowed down to the point where if I clicked to drop down a menu, the menu would not appear for several minutes, if ever. Actions such as opening or closing an application were completely out of the question. I could still move the mouse pointer at a normal pace. It's just that I couldn't get it to do anything.
I did my usual first attempt at a fix: I restarted the Mac. I had to use the physical power button on the front of the machine, as no mouse click or keyboard command would work by this point. Happily, all returned to normal - but only for a while. Within a few hours, the "slowdown extreme edition" once again reared its head.
Donning my Sherlock Holmes cap and a pipe, I set out to uncover the villain.
I restarted the Mac once again. This time, before the Mac started reacting as if it were caught in a vat of congealing taffy, I launched Activity Monitor (an application in OS X's Utilities folder). I monitored my activity. At first, nothing. Then, it happened. The WindowServer process started moving to the top of the "% CPU" column: 25%, 40%, 62%, 78%. When it got to about 75%, the slow down really kicked in. By the time it topped out at 99% (and stayed there), everything had ground to a halt.
What is WindowServer? In brief, it handles windows. It is the core process responsible for drawing the windows and boxes that make up the graphical user interface. As Apple notes: "The window server does more than just manage windows. Even an application with no user interface (like a background-only application) depends on the window server."
In other words, it's important. And it's exactly the sort of process that, if it got bogged down, would produce the sort of symptom I was seeing.
I now had a prime suspect. But the key question remained unanswered: Why was WindowServer bogging down? It had never done so in Snow Leopard. And it wasn't causing problems on my other Macs with Lion installed. So what made my Mac Pro running Lion special?
I assumed there was yet another piece of software involved. Most likely, it was something from my Login Items list, something not on my other Macs. These items launch automatically at startup, allowing them to cause trouble without the user having to take any "manual" action. But which item?
I searched online for possible guidance. I found several forum threads dealing with WindowServer slowdowns, describing symptoms similar to my own. But the threads either came to no conclusion or identified a cause that was not relevant to my particulars. Dead end.
Back to my Mac. I launched Console (another application in the Utilities folder) and scrolled back through the messages to the point just before a slowdown had required me to restart. I found many error messages referencing a variety of processes. Several referred to ScreenSaverEngine. This seemed promising. I was using My Living Desktop as my screensaver. This is a CPU-intensive screensaver that plays "high definition movie videos." Maybe it was the other piece in the conflict puzzle.
My initial tests were not encouraging. The slowdown came back even if the screensaver never kicked in after a restart. The slowdown occurred even if I switched to a different screensaver. Finally, I removed the My Living Desktop component from my Login Items list, uninstalled the software, and restarted. Bingo! No more slowdowns!
I had one other "movie-like" screensaver on my Mac Pro: MacKiev's 3D Weather Globe. When I enabled this screensaver, the WindowServer slowdown again roared back. In this case, simply switching to another screensaver was sufficient to end the symptom. But I uninstalled the software anyway.
I now use one of Apple's built-in screensavers and have never been bothered by the slowdowns again.
There remains one unanswered question. It seems likely that not everyone running Lion has this problem with these screensavers. Otherwise, I would have expected this fact to show up in my search. So what is it about my particular setup that was triggering the screensaver-induced slowdowns? The My Living Desktop support site offers a clue.
Although the site doesn't list specific symptoms, it acknowledges a possible OS X Lion conflict between My Living Desktop and System Preferences items that similarly interact with "QuickTime movie playing." It cites Flip4Mac WMV (which I do have installed) as one potential culprit. My Living Desktop's recommendation is to uninstall Flip4Mac. I never got around to testing this, so I can't confirm if it works or not. But if you are experiencing any similar slowdowns, it's worth a try.