Skip to content

Instantly share code, notes, and snippets.

@walesmd
Last active December 13, 2023 05:06
Show Gist options
  • Star 81 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save walesmd/7315613 to your computer and use it in GitHub Desktop.
Save walesmd/7315613 to your computer and use it in GitHub Desktop.
A lot of people are having issues with com.apple.IconServicesAgent. Since this is a very new issue, Google was no help and `man iconservicesd` is even more hilarious. I eventually fixed it, when I was working on a completely different issue (that is still not fixed). The instructions are below and on the Apple Support Forum, https://discussions.…

I was chasing down another issue (slow "Save As") and thought these two issues may have been related (with QuickLook being the common broken link). Unfortunately, my "Save As" dialog is still miserably slow on the initial load; but IconServicesAgent hasn't gone above 30MB and he rarely makes an appearance in the Console!

Some of these steps may not be necessary, but here are all of the steps I took that inadverdently put IconServicesAgent back in its place. Note: all commands are a single-line, if they appear to be multiple that's just the forum formatting.

  1. Check for any QuickLooks related .plist files. In a terminal: mdfind com.apple.quicklook. -name .plist

  2. I only had files at the system level (specifically within /System/Library/LaunchAgents/). If you have others, modify the directions below to take that into account (re-introducing plist files from the system level back up to the user).

  3. Make some temporary directories to store these plist files, just in case: mkdir ~/tmp-quicklook

  4. Kill the IconServicesAgent: killall -KILL com.apple.IconServicesAgent

  5. Move the plist files to temporary directories: sudo mv /System/Library/LaunchAgents/com.apple.quicklook.* ~/tmp-quicklook/

  6. Reset QuickLook generators and disk cache: qlmanage -r && qlmanage -r cache

  7. Reboot

  8. Move plist files back: sudo mv ~/tmp-quicklook/com.apple.quicklook.* /System/Library/LaunchAgents

  9. Reboot

From this point on you shouldn't see IconServiceAgent ever go above 30MB on the memory tab; Twitter is actually consuming more memory than IconServiceAgent is right now! You will continue to see entries in your logs but they should only occur once per file type, roughly. I found just scrolling through "All My Files" in Finder really quick took care of most everything and after another reboot and repeating this process - I saw very few, if any, new entries.

If this doesn't work, my only suggestion would be to remove all entries from the user's Login Items and then go through the instructions above (I did this but I don't beleive it was relevant, therefore the ommission).

@eseiver
Copy link

eseiver commented May 29, 2019

In OSX Mojave (10.14), System Integrity Protection means that you can't move the plist files. To turn it off you need to reboot in safe mode (holding down Command + R), open Terminal and run csrutil disable. When you're done all the steps you should re-enable it in safe mode with csrutil enable.

@rcatyvr
Copy link

rcatyvr commented Jul 10, 2019

I have tried the above suggestions and still, no joy. I have also reniced both the services agent and its calling daemon down to +20, but still, when I highlight an item in finder the has a custom icon, the deep snooze takes off again and all I can do is if I have left a terminal open, just keep killing the service until I get some control back. Restarting finder does not help as when it comes back, so does the icon service agent.

Any other ideas?

I feel like downgrading to High Sierra or even giving up and turning my iMac in to a Debian computer.

@AzaubaevViktor
Copy link

Just reboot and it ok

@skull-squadron
Copy link

skull-squadron commented Apr 14, 2020

Bloody hell. IconServicesAgent was using 900+ MiB and scanning every byte of every movie for an entire movies folder over a network share. Crapple strikes again.

(Don't get me started about spotlight's misbehavior.)

@redfirebrooks
Copy link

Hello, I had this problem for a while and every solution I tired so far gave little or no result. Each time I tried I use finder to see the content oh the user directory the inconservicesagent freeze the finder for 5 or 10 min. It happens also when I change the view type from list to icons or cons to list.

I tried this command but it gave me no clue of what was happening
sudo fs_usage -w -f filesys com.apple.IconServices

Then I realised that this commend was for older OS so instead I tried:
sudo fs_usage -w -f filesys iconservicesagent

And BINGO... the iconservicesagent was busy dealing with an encrypted dmg I have in my home folder which has a custom icon. I deleted the custom icon of the dmg and now so far so good no more crazy iconservicesagent behaviour.

I tried to use a new custom icon but the problem reappeared... so definitely it is a bug with customs icons...

Hope it willl help.

@Kristine1975
Copy link

Kristine1975 commented Aug 15, 2021

I had that happen to me on 10.14.6. IconServices went to 8GB in seconds. Killing it, killing Finder and killing it again helped temporarily. Turns out the problem was a huge .rar file that IconServices didn't like for whatever reason. Deleting it in Terminal fixed the problem (didn't need the file anymore).

A few days later it happened again, this time while downloading a 10GB .tar file. Closing the Finder window that showed the directory with the incomplete .tar file and killing IconServices a few times fixed the problem. Memory usage went down and stayed down, no reboot necessary. After the download was complete, IconServices continued to behave.

So it seems IconServices has a problem with some big files. Maybe it tries to read the whole file into memory when searching for a custom icon?

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