Written by
Jenny ZengSummary: This article explains a background process called "iconservicesagent," which you can find in Activity Monitor. It tells you what iconservicesagent is and what to do when it consumes a large chunk of your Mac's RAM and CPU.
My Mac is running macOS Mojave and it hangs all the time with the beachball. When I check Activity Monitor, I find a proceess named "iconservicesagent" hogging up all the RAM. What is this process? How do I stop iconservicesagent from eating up the memory?
The issue of iconservicesagent spiking Mac's CPU and RAM can happen on all macOS versions, especially on macOS Mojave and High Sierra. It bogs down the system, rendering it unresponsive and unusable.
In this article, we'll cover several proven solutions that can help you stop iconservicesagent from using up the CPU and RAM resources. Let's start by understanding what the process is.
What is iconservicesagent on Mac?
Iconservicesagent is an agent the Mac operating system uses to read and generate icon images from the resources provided in application bundles and by the system.
It handles requests for icon generation and serves those icons to applications and other processes. For example, when Finder needs to display a custom icon for a file or application, it might call on iconservicesagent to provide the appropriate icon.
Share this post to benefit other Mac users!
How to fix iconservicesagent high CPU and RAM usage on Mac?
When iconservicesagent struggles to process custom icons, it'll consume a large amount of CPU & RAM on your Mac. For instance, if a folder on your external drive has a custom icon, you may notice iconservicesagent starting to tax your Mac's RAM and CPU whenever you open the folder.
If that also happens to you, take the following solutions to fix it.
Fix 1: Clear the IconServices caches
One proven way to fix the iconservicesagent high CPU or RAM issue is to clear the IconServices caches. This is useful for all kinds of weird behavior with icons on Mac.
- Open Terminal.
- Run the following command to remove the main store.sudo rm -rfv /Library/Caches/com.apple.iconservices.store
- Enter your admin password and press Enter.
- Run the following command to remove the subsidiary data and Dock icon caches.sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \;
- Restart your Mac and give it time to rebuild the caches.
Fix 2: Change the custom icons to the default
Since the issue is usually caused by custom icons, you can go back to the default icon to stop iconservicesagent from hogging up all the RAM.
- Select a file or folder that has the default icon.
- Right-click on it and choose "Get Info."
- Click the small icon at the top of the window.
- Select Edit > Copy in the menu bar.
- Select the file or folder that has a custom icon you want to change.
- Right-click on it and choose "Get Info."
- Click the small icon at the top of the window.
- Select Edit > Paste in the menu bar.
If you have multiple files or folders with custom icons, try running the following command to set all files and folders on your Mac to the default icons.
find / | while read f; do xattr -d com.apple.ResourceFork "$f" 2>/dev/null; done
Warning: This command is very broad and can potentially modify a large number of files and folders. Always back up important data before running commands like this.
If you're only looking to remove custom icons from folders and not touch other files, use: find / -type d | while read f; do xattr -d com.apple.ResourceFork "$f" 2>/dev/null; done
If you're only looking to remove custom icons from files and not touch other folders, use: find / -type f | while read f; do xattr -d com.apple.ResourceFork "$f" 2>/dev/null; done
If you only want to remove custom icons from a specific folder, use: (Replace ~/Movies with your folder path)
find ~/Movies -type f | while read f; do xattr -d com.apple.ResourceFork "$f"; done
Fix 3: Delete the dot file on Windows
If iconservicesagent begins to eat up your Mac's memory after an external drive is connected, try opening it on a Windows PC and deleting files with a dot. This way, you can get rid of the custom icons.
- Insert the external drive into your Windows PC.
- Open it and delete the files and folders beginning with a dot.
- Empty the Recycle bin.
- Reconnect it with your Mac to see if iconservicesagent behaves.
Have you resolved the issue? If you find this post useful, please share it with others.