Finder Grinder: The CPU Syndrome

I’ve had a problem for a while on my macbook (running Leopard) that the Finder would just suck up CPU like crazy.  Restarting it often didn’t change anything.  I never found any useful information googling on it, until recently.

In this thread I hit on the idea of sampling the Finder process, and when I did so, I found that the biggest sucker of CPU was a function called “getdirentriesattr.”  Googling *that* up, I found reports that this function is used iterating through really big directories calculating folder sizes, and that in fact:

It looks like it is iterating some directory to get its total size. This happens on my machine when I either File Menu->Get Info on a very large folder, or view the folder in List View with Calculate Folder Sizes enabled. Its trying to get the total size of that directory. Apparently there is a bug where the Finder doesn’t stop trying to get the size after you have stopped viewing that folder, or even turned off Calculate Folder Sizes in List View (until you quit/relaunch the Finder).

I opened up a Finder window, pulled down View – Show View Options, and deselected “calculate all sizes.”  I made that the default, and then restarted Finder.

Suddenly my Finder’s at 0% CPU instead of a steady 20-80%.  And my fan isn’t on all the time.

SWEET.  Thank you Apple for having the tools that made it possible to dig down into the process and discover this, but nuts to you for that bug existing in the first place!

1 thought on “Finder Grinder: The CPU Syndrome”

  1. I am so trying this tonight when I get home. My fan has been on almost constantly for the last few months and performance has really taken a hit. Just hovering my mouse pointer over a link causes that stupid rainbow circle to start spinning.

Comments are closed.