Skip to content

Instantly share code, notes, and snippets.

@sgr
Last active July 25, 2020 11:01
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save sgr/7835954 to your computer and use it in GitHub Desktop.
Save sgr/7835954 to your computer and use it in GitHub Desktop.
When "com.apple.IconServicesAgent" exhausts CPU resources on Mac OSX mavericks (10.9), you can try following workaround.
#!/bin/sh
mkdir ${TMPDIR}/com.apple.IconServices
@henrik242
Copy link

This was it! When I arrived at work today IconServicesAgent was consuming 226% CPU. After creating that folder, it dropped to 0.2% after a couple of seconds. Thank you!

@jinuem
Copy link

jinuem commented Jan 15, 2014

Is this a permanent solution or temporary fix?

@sgr
Copy link
Author

sgr commented Feb 16, 2014

This is just a workaround :-(

@devlaam
Copy link

devlaam commented Feb 23, 2014

After several weeks of testing i found that sometimes this produces an incorrect path and does not kill the iconizer effectively. It is not clear to me why this is, but i advise to add the -p option here which solves these rare cases and does not harm otherwise, thus:
mkdir -p ${TMPDIR}/com.apple.IconServices

@sgr
Copy link
Author

sgr commented Feb 28, 2014

Maybe $TMPDIR was overwritten in your environment. If $TMPDIR indicates an wrong path, it should not be created.

@devlaam
Copy link

devlaam commented Mar 4, 2014

What should happen and what really happens are two different things. I noticed three (and verified two) occasions where the last dir of the TMPDIR path contains an incorrect name (some capital letter). After manually creating that last directory and applying your fix, the problem was solved. So i figured that there may be others that are in the same situation but do not detect why your workaround does not work for them. Hence my tip. Thank you btw for this "solution".

@voronianski
Copy link

it throws me

MacBook-Pro-Dmitri:~ dmitri$ mkdir ${TMPDIR}/com.apple.IconServices
mkdir: /var/folders/5z/pgm_8b253pq6nf3rg2kjlfxw0000gn/T//com.apple.IconServices: File exists

@wolframteetz
Copy link

I found a fix that seems to work, see http://blog.hsoi.com/2014/02/25/my-slow-mac-mavericks-coreservicesd-iconservices agent-and-how-fs_usage-saved-me/comment-page-1/

If you have the same problem and the solutions given in this thread don't work, please run sudo fs_usage -f pathname -w com.apple.IconServicesAgent | grep open in the Terminal and post your output here.

For me, XCode seemed to be the problem.

Uninstalled XCode by sudo -r /Applications/XCode.app. Cleared all caches by sudo rm -r /Library/Caches and ~/Library/Caches, then mkdir of the same (don’t know and think that this step is necessary). Reinstalled XCode.

Problem gone.

@torgeir
Copy link

torgeir commented Sep 23, 2014

mkdir ${TMPDIR}/com.apple.IconServices worked for me. Dunno if it's just temporary, though

@smugsnug
Copy link

this what i got - after 12 hours of

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

[0x211] flags: 0x8 binding: FileInfoBinding [0x647] - extension: jpg, UTI: public.jpeg, fileType: ????.

@kopurando
Copy link

In my particular case, following did NOT help:

killall -KILL com.apple.IconServicesAgent

mkdir -p ${TMPDIR}/com.apple.IconServices

However, I was watching its behaviour via

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

and saw extensive activity in various dirs (including VLC dir, and inside some system services dirs, like /System/Library/Extensions/IOStorageFamily.kext/Contents/Resources). I could reinstall VLC, but IOStorageFamily is sort of built in...

Anyway, after a bit deeper research, the culprit turned out to be XtraFinder! I restarted and updated XtraFinder, and so far IconServicesAgent has been quiet.

@NeoSalteador
Copy link

The first sorry for my English. I am Spanish and I try to write so that you understand me.
I have the problem you described long ago about iconservicesagent, a process that triggers to consume RAM when I open an external hard drive.
I have been communicating with apple technicians but I have seen that all they did was experiment with my computer without knowing exactly what they were doing or why.
Finally, I told them that what I wanted was for them to look for the global error and make a patch, because it was evident (it was only necessary to search Google for "iconservicesagent" to see that many more people were the same), it's a big problem.

I do not know if you have continued investigating about that problem, but I would like to know if you have any progress because I can not work with that external hard drive and from Apple they do not find the solution.
Thank you very much for your time. Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment