How To Stop CalendarAgent From Eating CPU

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[379] Unexpected EOF, returning last token as fallback

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:

  1. 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.
  2. Delete ~/Library/Calendars/
  3. Delete ~/Library/Preferences/com.apple.iCal.plist
  4. Go back into the “Mail, Contacts & Calendars” pref panel, put the calendar back. Give it some time to download.

That seems to have worked for me.

19 thoughts on “How To Stop CalendarAgent From Eating CPU

  1. Robert, you are AWESOME!! I have been troubleshooting for over a week – this issue has been driving me crazy. I tried everything and nothing worked until this fix. Now everything is back working perfectly, fast and smooth with no rainbow balls or s-l-o-w applications. CalendarAgent went from being a big fat slob hogging about 8 GB of virtual memory to a dainty reserved southern bell sipping tea. Thank you so much, Robert!

  2. Could you help me with this in Mountain lion ? I have calendars in exchange, icloud and google calendar

  3. This not only worked, but iCal and Reminders now open about 10 times faster than they did previously.

    Thank you!

  4. Robert, it sounds like you’ve solved the problem I’m having. Only one issue on my end: neither of those files exist on my computer. Are they hidden by default?

    Is there some reason I wouldn’t have those? I’ve got some calendars syncing through iCloud (the problematic ones, I suspect) and others that sync from GMail through Busycal.

  5. Can’t find any ref to iCal at all in 10.8.4. So jealous of those who have fixed. I have to keep quitting CalendarAgent several time a day.
    What a pity Apple leave it all to their customers to sort out while they gloat over their billions. Do they whisper “Suckers” to themselves as they do? Still, it’s better than Microsoft.
    One day, the Volkswagen of computing will step forward. Well made, reasonably priced and with a responsible attitude towards their customers. Hope I live that long.

  6. Rob, you saved my day. Thank you so much. That simple advice is applicable for non super users like me, and really fixed the problem. Enjoy your day!

  7. Hi Rob,

    I have the same problem, but now on Mavericks – and when I got to the Library folder as mentioned in your article, there are no such files to delete! I am not sure where they could be or what they could be called, but please help!! I have restart my computer every 15 minutes, as it crashes once my RAM has been ‘~15Mb remaining’ for 15 minutes.

    Any Ideas?

    Thanks in advance,

    Nick

    • Well the problem seems to have fixed itself somehow – all i did was switch off my calendars in System Preferences, restarted my laptop and then it was fine. I added the calendars back in, and I haven’t had any problems again since (successfully) they loaded in.

      I did manage to find the calendar files you mentioned – in Mavericks they ALL seem to be ONLY in ~/System/Library/PrivateFrameworks. But like I said, I didn’t need to delete them in the end anyway!

  8. Thanks for this!

    I am quite frankly shocked that APL are not all over this. I have had macs of varying types over the years and have always bragged about how they don’t slow down, get viruses etc etc. I had to keep very quite about this one or face ridicule (hubris is a terrible thing). I have seen heavily infected windoze machines behave better than my MBP was doing. And this came out of the blue with Mavericks. Never seen this before. Really disappointing to be honest. But thanks a million for the heads up!

  9. Where do I find the ‘Mail, Contacts & Calendars” pref panel? I have no such pref in system preferences.How do I switch off my calendars in system preferences?

  10. This worked for me on Mavericks. The cause for me was that my calendars are Google calendars, which the latest Mavericks now deals with more elegantly. However, when setting up a new iPhone, it defaults to turning iCloud calendar sharing on. I believe it may have been the conflict between these two that caused the explosion. I turned off iCloud calendar sharing on my phone, followed the instructions above, restarted my mac, and all is fixed.

  11. Thanks so much! This worked.. The problem started after i started syncing to Google. I tried skipping step 2, but ultimately had to blow away the entire calendar cache and start from scratch.

  12. After trying all these steps and failing I decided to reload Mavericks. This step does not delete your existing information. After the reload (which did take quite a while) the calendar issue was resolved. IT’s a daunting step – but in the end it was worth it. If you are concerned I guess you could back up your system with superduper or a time capsule first. Good luck.

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>