com.apple.IconServices taking up large amounts of disk space - why?

Solution 1:

To be frank, I wouldn't worry too much about it. You have plenty of space left. My IconServices folder was about 4 GB large and I had 3 GB of space left on my 160 GB SSD.

I can't tell you why Apple is creating or caching those files on OS X, sadly it seems to be a kind of mystery. I wasn't able to find out anything.

Anyway, after booting my Mac in safe mode (holding down the shift key on startup until the progress bar appears) and then booting up again, I ended up with 13 GB of free space. Try this to free up more space.

Solution 2:

My overall answer is the same as pattulus in that I wouldn't delete any files in /var/folders unless I had a plan for modifying the system to not recreate them. Especially on one like IconServices where the cached data will rapidly grow back to where the system wants that cache size to be and slow the system down in the mean time while it's rebuilding.

If you have multiple users (and all macs have some users that aren't your primary admin account) you're likely undercounting the IconServices storage penalty. Most Mac that are running with a few dozen apps and for 6 months or more on Mavericks will have between 500 MB to 1 GB of storage set aside for each user that IconServices has seen:

Mac:~ bmike$ sudo find /var/folders -name ISCacheTOC -exec sudo ls -l {} + 
-rw-------  1 502             staff           378016 Mar 12 11:10 /var/folders/04/g252hty50k15wmhckgpwfm6w0000gq/C/com.apple.IconServices/ISCacheTOC
-rw-------  1 503             staff           378016 Mar  9 18:08 /var/folders/gh/h072t02n1wngwzzqglbkdk580000gp/C/com.apple.IconServices/ISCacheTOC
-rw-------  1 504             staff           378016 Jan  6 21:55 /var/folders/rk/p7hlxttn44n05r2f_h4m6pmh0000gr/C/com.apple.IconServices/ISCacheTOC
-rw-------  1 bmike           staff           168016 Mar 14 12:19 /var/folders/tv/xyw2rpln7hq4gw2m0prg_src0000gn/C/com.apple.IconServices/ISCacheTOC
-rw-------  1 _securityagent  _securityagent  112016 Mar  7 13:27 /var/folders/zz/zyxvpxvq6csfxvn_n00000bh00002w/C/com.apple.IconServices/ISCacheTOC
-rw-------  1 Guest           _guest          112016 Mar 13 08:01 /var/folders/zz/zyxvpxvq6csfxvn_n00000s4000069/C/com.apple.IconServices/ISCacheTOC

In a case where you've deleted users, I suppose clearing those files would not harm anything and save some space in a pinch. For me, the space savings for swap/sleep image/compressed memory in /private/var/vm freed up more space than the IconService caches have claimed thus far.

Here's how I'd calculate the size of all such folders, and you can chop off the | awk ... tail end to see each user's allocation if you wish:

Mac:~ bmike$ sudo find /var/folders -name com.apple.IconServices -exec sudo du -sm {} + | awk '{ sum += $1} END {print sum}'
3032