What's triggering my Finder's CPU binges?
Solution 1:
"I wish there was a way to "get inside the Finder's head" and see what it's doing. I've tried running a sample of the Finder process in Activity Monitor, but honestly I don't know what it's doing, much less how to interpret the output."
Taking a sample in Activity Monitor is exactly that: getting inside the Finder's head to see what it's doing. While it may seem like greek, I or others here can interpret it for you. Just post it, or make it available for download or viewing (as they tend to be pretty big).
What version of OS X are you using? In OS X 10.5.x and prior, I believe multimedia content ran within the Finder itself, rather than delegating it off to an agent/helper type process, so then the CPU usage may appear higher. For example, previewing a QuickTime movie might make the 10.5.x-and-earlier Finder spike to 60% CPU, while in 10.6 it might be split to something like 10% CPU for the Finder, 30% CPU to the QTKitHelper background process.
Otherwise, I've sometimes seen the code the Finder uses to calculate the size of the contents of a folder cause temporary CPU spikes. (You'll notice something like TSomething::HFSSizerSomething
in the stack trace of a sample). Usually it seems insistent on finishing its calculation even if the view you had open that warranted the calculation has since been closed.
In any case, seeing the sample should help pinpoint the issue along with knowing what context led up to the spike. It'll be easier to explain what taking a sample is doing once we have it in front of us to look at.
Solution 2:
You have DTrace available.
man -k DTrace
Those tools, plus fs_usage -f filesys should give you the answer.
Solution 3:
Change the finder > preferences > General "New Finder Window Show" option to anything but "All my files". This helps a lot.