Finder takes long time to load some folders

When opening some folders, the Finder takes a long time (30-60 seconds) to load all the files in it. Specifically, these folders typically contain 10-50 PHP files (which are text files), each about 10 kb.

I also notice that sometimes, after the files are listed, their icons are still loading and the "Kind" column is also still loading. (I've got the "Name", "Date Modified", "Size", and "Kind" columns showing; "Calculate all sizes" is enabled" while "Show icon preview" is disabled.)

In addition, when opening a directory such as this and viewing Activity Monitor, I see that coreservicesd is at 70% CPU and Finder is at 30% CPU. After all the files have loaded, both services are still at these CPU levels for about 60 seconds afterward.

Anyone know how I can fix this? I already did "Repair disk permissions" and "Repair Disk", along with a ton of miscellaneous Onyx tasks, but the problem still remains.


Solution 1:

Hallelujah! I figured it out. Okay, so first thing I did was create a new account, as suggested by another answer. The problem did not occur in there, so clearly the problem was limited to my account. I then went into Safe Mode into my account. The problem did not occur as well. So clearly something was loaded in normal mode but not in safe mode that was causing the problem.

While in safe mode, I then cleared the caches (in Terminal, using sudo mv /Library/Caches ~/Temp/ and the same for ~/Library/Caches). Problem solved! I've had other problems as well in Finder so perhaps this will fix this as well. I'm curious as to why using Onyx to clear the User caches didn't clear these as well, but anyway, from what I've read online it seems like getting rid of these two folders is safe. Also, Time Machine never backs up ~/Library/Caches (but it does back up /Library/Caches), so that's reassuring.

In addition, while this post was made in 2003, it still applied to my situation and this was what convinced me to clear my Caches folders.

Solution 2:

There are many things you can try to fix this:

  • Trashing com.apple.finder.plist, com.apple.systemuiserver.plist and com.apple.loginwindow.plist (they will be recreated when you launch Finder) in ~/Library/Preferences and Force Quit Finder
  • Turning off Calculate All Sizes in Finder
  • Turning off Show View Options in Finder

Another thing you can try, is to create a new (test)account and see if the problem still exists there. Chances are good you'll solve your issue with this.
Worst case scenario, you can move your account to a new one to solve this issue.

Solution 3:

I had the same problem, but none of the fixes above helped. This finally did:

http://blog.hsoi.com/2014/02/25/my-slow-mac-mavericks-coreservicesd-iconservicesagent-and-how-fs_usage-saved-me/

Some issue with an application (in my case Xcode) and icons.

Try this command in Terminal, which reports realtime filesystem activity from the IconServicesAgent:

sudo fs_usage -f pathname -w com.apple.IconServicesAgent | grep open

I got endless output like:

/Applications/Xcode.app/Contents 0.000009 com.apple.IconSe.429515:32:08.066965 open F=4 (R_____)
/Applications/Xcode.app/Contents/Info.plist 0.000010 com.apple.IconSe.429515:32:08.067690 open F=4 (R_____)
/Applications/Xcode.app/Contents/Library/Spotlight 0.000003com.apple.IconSe.429515:32:08.092972 open F=5 (R_____)

I moved Xcode to the trash, and reinstalled from the AppStore. Problem solved, now I have a snappy Finder.