How can I diagnose or fix the CalendarAgent occupying a whole CPU on Mountain Lion? Since I upgraded to Mountain Lion from Lion I see the CalendarAgent process occupying a large amount of 1 CPU on my late-2008 MacBook Pro. To fix this (as suggested by a Google result) I tried removing all online calendar accounts then re-adding them. This seemed to work for a while, but now the problem has returned (perhaps due to me either deleting some iCloud calendars or adding an additional Google calendar delegate). I don't really want to have to remove all my calendar accounts each time I add or remove a single calendar, so can anyone point me to the root cause of the problem?

In case it's useful, the call graph from the process is pasted here.

UPDATE: I removed one of the delegates from one of my Google calendar accounts, and that prevented this problem occurring. This isn't really a solution though, as I now can't access that calendar.
May have to kill and rebuild Calendar db:


Disable the Calendar service from your account in System Preferences → Internet Accounts
Remove the preferences/database files for Calendar:

rm -r ~/Library/Calendars/ ~/Library/Preferences/com.apple.iCal.plist

Re-enable the service.


Source: http://robert.accettura.com/blog/2012/08/19/how-to-stop-calendaragent-from-eating-cpu/