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.

Tags: ,

Related Posts

Related Posts


32 Responses to “How To Stop CalendarAgent From Eating CPU”

  1. Daniel says:

    Thank you so much!! I had been looking all over to find the right thing to do. This worked.

  2. Andy says:

    Thanks for this, seems to have been the only way I could fix it.

  3. Lolly says:

    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!

  4. lebi says:

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

  5. Nick says:

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

    Thank you!

  6. fetag says:

    Thank you! It’s works for me and tune my Mac faster.

  7. nicholas says:

    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.

  8. lokioki says:

    i tried this but didn’t work. instead this worked for me:

    http://productforums.google.co.....XZkRZzo10I

  9. Rob says:

    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.

  10. Patrick says:

    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!

  11. Lex says:

    Thank you Robert. It works. It’s great!

  12. Nick says:

    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

    • Nick says:

      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!

  13. Craig says:

    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!

  14. Barbara Hooper says:

    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?

  15. Scott says:

    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.

  16. caro says:

    it worked once but again its running slow….
    helpppppp

  17. Brad Johnson says:

    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.

  18. Mark Jefferies says:

    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.

  19. Eugene says:

    On Yosemite it helped me without steps 2 and 3. I just turned off Google and iCloud calendar sync, reboot computer and turned it on again.

  20. MrRaph_ says:

    Thanks a lot for this, you saved my old MacBook Unibody šŸ™‚

  21. playniuniu says:

    Thanks a lot, it still working in my macos sierra 10.12.1

  22. mal0 says:

    Yes ! still working (10.11.6), thanks a lot

  23. Ash says:

    Guys, also try deleting old completed Reminders – that helped me a lot. Still seeing spikes but the duration has gone down SIGNIFICANTLY.

    • Jack says:

      I just deleted about 2000 completed reminders and CPU time for CalNCService and CalendarAgent dropped form the 50-85% range almost constantly to nominal amounts to about 20% occasionally.

  24. Fred says:

    +1 after an attack of the calendar agent cpu spikes, thanks

  25. Digglerman says:

    Works fast and without problems. Never the less a backup of the removed files might be a good idea!

  26. Josh says:

    Seemed to work on 10.12.6 with 2015 MBPr. Does anyone notice this issue arise after connecting to an external monitor. The last time this occurred was after I connected to an external monitor. Used the fix on this page and it stopped. I have since connected to the same monitors without problem. Connected again to a previously “no issue” monitor at home and the monitor flickered on and off for about 10 seconds at a time and the fans started kicking in on my MBPr, the Calendar Agent was using nearly all CPU again. I performed the above and everything quiets down. Anyone else see a relationship b/w external monitor use and this issue?

  27. drw says:

    Had the same Problem on 10.12.6 in Jan. 2018 from one to the other moment. Because having a huge amount of calendars I tried to avoid a blank setup.

    As I examined the ~/Library/Calendars/ Folder I found out that there were a few incoming and pending events that were not shown in iCal.

    After backing all things up, deleting these items, killing Ā»CalNCServiceĀ« and restarting iCal the CPU-usage if Ā»CalNCServiceĀ« is down to 0 to 2.5%.

    Hope that works for anyone else! Cheers drw

  28. Mike says:

    Do you have instructions that work on High Sierra?

    Thank you.

  29. Scott Gurley says:

    You the man – appreciate it! Worked great. Why does OSX suck so much like this…

  30. Vadim says:

    It also helped me with high CPU usage of CalNCService. Tried a lot, but only this totally fixed the issue! Thank you!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.