This is a known bug that has been reported widely.
First, if you are using a third-party font management program (commonly used by graphic designers with large libraries of fonts) such as FontExplorer or Suitcase Fusion, disable that utility. Contact the publisher of that font utility for information about an update or workaround to deal with Lion and/or Safari 5.1 incompatibility problems.
Second, try clearing your font caches. One way to do this is to boot in Safe Mode. Start up and as soon as you hear the startup chime, hold down the Shift key until the operating system starts to load (after the grey Apple logo, when the rotating 12-point clock symbol appears). It will take longer than usual to start up because the Mac will be doing some diagnostic and maintenance work, including deleting your old font caches so the system can build a new one. Once startup is complete, and you are back to the Desktop and Finder, you should restart, because some functions won't work while the Mac is running in Safe Mode.
Alternately you can use a utility like Onyx or Cocktail to clear your font caches.
I had this same problem on my new MBP Retina. I do have Parallels installed, but the similar issue caused by Parallels has been fixed in a Parallels update (which I've installed). Moreover, none of the workarounds (e.g. deleting the Windows Applications folder from the Dock) suggested on the Parallels forum fixed the problem for me. I also tried to delete the Dock's plist, restart the process, and restart the computer several times. None of these fixed the problem. The Dock process would go back to using 100% CPU.
Here's what I did to troubleshoot and fix it:
Run this from the command line. This command will list the files the Dock process is accessing or tying to access.
sudo opensnoop -n Dock
I found that Dock was repeatedly trying to access /System/Library/CoreServices/DefaultDesktop.jpg
, which is a symbolic link to /Library/Desktop Pictures/Galaxy.jpg
. The only problem was that /Library/Desktop Pictures/Galaxy.jpg
didn't exist. I'm not sure if the OS came without it at that location or if I deleted it or moved it mistakenly. Regardless, to fix this I repointed the symbolic link to another desktop picture using the following two commands:
sudo rm /System/Library/CoreServices/DefaultDesktop.jpg
sudo ln -s /Library/Desktop\ Pictures/Lion.jpg /System/Library/CoreServices/DefaultDesktop.jpg
It seems that the problem was that Dock was repeatedly trying and failing to access the missing Galaxy.jpg file to set my desktop background via the DefaultDesktop.jpg symbolic link. Once that symbolic link pointed to a real JPG file, Dock's high CPU utilization stopped. On earlier MBPs, DefaultDesktop.jpg was a real JPG file (of a galaxy).
Also this fixed another problem I was having where if I locked my screen and then typed my password to unlock it, my computer would hang while trying to log me in. My hunch is that the Dock was trying to access the same missing file and was hanging on the login screen.
Best Answer
Found this answer on CNET: