Thanks! I tried Ola_M's procedure "How To Stop CalendarAgent From Eating CPU", and it worked very well. Now things calmed down.
I was having the same extreme use of cpu by CalendarAgent, and I don't have ANY calendars except iCal, so it's got nothing to do with Google (in my case).
But I do have calendars WAY BACK. I didn't quite understand, how do I get rid of those old calendars?
I've had memory leaks caused by Calendar Agent. Tried the fix above, pasted below for convenience. Calendar is using 188MB of memory and Calendar Agent 198MB. 0% CPU for both. Memory use is down 50-150 MB from before teh fix, but it still seems like a lot. I have notifications turned off, but I still get them.
How To Stop CalendarAgent From Eating CPU
Posted on 8/19/2012
Recently ran into an issue with Calendar causing a huge CPU spike. Checking the system.log I noticed the following repeatedly in my log:
CalendarAgent is essentially Calendar’s backend (that’s how it’s also able to power the notification center). The best resolution I’ve found is to completely clear out the calendar and recreate it. Process I used was as follows:
- Remove the Calendar from “Mail, Contacts & Calendars” pref panel (just uncheck from the account). Then go into Calendar and make sure the account is removed. If it’s not, remove it.
- Delete ~/Library/Calendars/
- Delete ~/Library/Preferences/com.apple.iCal.plist
- Go back into the “Mail, Contacts & Calendars” pref panel, put the calendar back. Give it some time to download.
UPDATE: My iCal had automatically (re)set up an iCloud subscription to Birthdays (I'm sure I had set this up previously using this approach (http://support.apple.com/kb/PH2676)).
I unchecked the Birthday subscription from iCal's left pane (Calendars). I killed the CalendarAgent process using Activity Monitor. It restarts automatically. After an hour, it had grown to only 391MB and used only 1 minute of CPU.
1330 CalendarAgent marvinrichardson 0.0 5 391.8 MB Intel (64 bit) 1:09.76
I have a 4 core system, so if I understand the way CPU time is reported, this is only 1/240th of that hour's capacity (240 CPU-Minutes = 4 cores x 60 minutes).
Still seems crazy to use that much real memory. By comparison that's more than Firefox and Mail combined are using currently with similar light activity and short run times. But, I'm fortunate to have lots of capacity ...
I just deleted my calendar cache, and the Calendar Agent has been quiet - I'm hopeful, but not convinced. Has anyone figured out the fix? I am no longer using iCal and have unchecked all of my calendars, turned off calendar in my iPhone - basically, having to go with Outlook as my only calendar, which I hate.
Well throwing out iCal isn't really the fix that we wanted, is it? I tried the fixes and everything calmed down ... for a while (actually a few days!). BUT now we are back!
But one good thing: I was contacted by Apple, who asked me to upload some data to them, and they would get someone to look at it . So hopefully in the future there will be a solution to the problem ... I hope!
In the meantime I will continue to "strangle" CalendarAgent via Activity Monitor. It's a drag, but hopefully it's worth waiting for.
It is strange that Apple ignores this serious problem for many. I can only again recommend what solved it for me; - copy all entries you need into a new calendar and delete the old one. At one point I got a new couple of "dummy" entries in a minor calendar I had not done this with, which were easy to delete. In the new calendar no dummy entries have appeared after several omnts of use and syncing across devices. Regards
I'm sure Apple isn't ignoring the problem. Many months ago, I was contacted and asked to supply some diagnostic data after reporting this issue, so it seems it has been looked at.
For me, the problem went away. I don't really know why I'm afraid. It might have been an OSX update or it could have been my removal of some older calendar entries and cleaning up. All I can say is thst I've not seen the problem for months and CalendarAgent on my old MBP is currently 31MB according to ActivityMonitor - and that's after running for 20 days.
There is no solution to this. I've been playing around with this in every way imaginable and it always comes back. Others have found their own work around or a temporary solution, but nothing permanent. Until Apple comes out with a permanent fix, everything you're reading are just workarounds.
That said, here's my personal workaround:
- I have two calendars, one Google (which does have delegates) and one is my work email via Exchange.
- I have turned off the notifications and unchecked any delegates for the Google calendar and Exchange Calendar.
- Issue still occurred.
- I deleted both calendars and cleared the cache
- Issue goes away, obviously.
- I experimented with only adding one calendar, and when I just add my Google calendar (and remove items listed in #2), issue still occurs. However when I just add my work calendar (and remove items listed in #2), I don't get an out of control CalendarAgent.
No software, or coding, or scripts needed. ***** I can't have my Google calendar on my Mac, but I sync it with my work calendar so I didn't really need it anyway.
Now I'm just worried about all the damage the heat and high processing has done to my battery and processor.