See latest update at: [buymymonkey.wordpress.com/2020/03/04/apple-mail-cpu-spike-brought-in-the-big-guns-short-update/]
That’s the sad sad news. Sadder than sad can be. But also frustrating. Let’s recap.
Yes, you can remove all of your accounts and the issue will go away.
Yes, you can set mail to manual updates and the issue (should) will go away.
Yes you can remove all of your Office365 accounts and the issue (may) will go away.
… But that’s all having to accept a poor solution to a persistent problem. So I’m not giving up. I’m running some tests with a variety of options turned on/off and will report back shortly.
Apple should be ashamed in that there’s a number of people posting on this, and no information back from Apple.
I’m also about to give up on HomeKit. I can control devices on my phone, but can’t share my “Home” to my Family Account devices. Just doesn’t work. That’s coming next.
More to come….
P.S. When I started writing this post, I quit Mac Mail and Quit Mac Outlook Mail. I then killed accountsd. Now via Activity Monitor, in the last 7 minutes, it’s grown to 39MB already. The only other recurring integration then would be Mac Calendar (since it uses account information from accountsd as well). Hmmm…
I’ll let it sit overnight.
No CPU spikes. Here’s the size of accountsd after running without Mail or Outlook all night. Already above 330MB so the growth is not as fast as when all mail clients are running, but what the heck is it doing? Is it “Contacts” sync or “Calendar” ? Clicking Info on the process shows 6GB of virtual memory allocated.
Next I’ll run just Outlook Mail and see what happens (first I’ll kill accountsd to reset the memory use).
Welp it’s still an issue. Accountsd continues to grow until it uses enough memory that Memory starts swapping to disk, and that drives CPU up and then to quote Bill Paxton in Aliens: “game over, man, game OVER!”
So next I completely deleted the Mail directory, and allowed it all to re-download and re-build. No improvement.
Next, I moved my Exchange to MS Outlook for Mac, and left only the IMAP accounts using Mac Mail. This helped, but the size of accountsd continues to grow, albeit more slowly. It’s now at 278MB after about five dates. Virtual memory is now over 6 GB. CPU hasn’t spiked yet – so I’ll wait and see – but it feels inevitable since the size continues to grow.
This is definitely a crazy problem likely related to a memory leak. The number of ports that the process opens continues to grow.
Now up to 547MB with 6.29GB of virtual memory. So the fix is not there after moving all Exchange mail accounts to Mac Outlook (including Contacts, Notes and Calendars). So ALL I have is Gmail accounts using Mail. It’s not Exchange related.
More things I’ve tried – getting better but not solved –
I applied the updated release to Catalina: 10.15.3 (19D76)
I removed the Messages directory completely and had it recreate and re-synch, by following the instructions on this page (and restarting my Mac): https://journal.willhackett.com/macos-messages-fresh-hell-d74c6e48acfb
In summary, here’s what it says to do –
- Open Terminal.
- Kill IMDPersistenceAgent—to do this enter the command:
- Remove the Messages database:
rm -rf ~/Library/Messages
- Clear the preferences cache by running:
Then reboot – launch messages and let it rebuild.
I Reset My Home Permissions
Given all the “cannot access private account…” messages in the Console.app, I opened up Finder, went to my home directory and then selected the gear icon at the bottom to reset the privileges and ownership of that directory and all subdirectories to my user account.
I Turned off Hand Off
Just a shot in the dark. Didn’t help.
I Ran in Safe Mode
Sometimes running in Safe Mode for a bit will actually clear things up in terms of permissions and access to services. Not in this case.
(To run in Safe Mode, restart your Mac and just went it starts restarting, depress and hold your SHIFT key until you get to the Login window.)
I’m seeing accountsd growing slower but still growing. Takes about 4 days now for it to reach a size that causes swapping and CPU burning.
However, one of the items above has removed the “No TCC State Found” messages from my Console log.
Also seeing some messages that read:
Unentitled access by client ‘CallHistoryPlugi’ (selector: accountsWithAccountType:handler:)
This is referring to CallHistoryPluginHelper process, which is in the process list but small in size.
My theory still is that something is failing and throwing an exception in the code in accountsd, and in handling that exception, memory is not being released. And so it grows and grows. Trying to associate a console error message with the growth in size but it’s challenging. I might start peeling part the “Sample Process” output.
My other theory is that this only happens to people who have UPGRADED to Catalina. New machines don’t have this issue. I have no evidence of this since people without the problem would never make it to this post.
Work continues…. (this is getting ridiculous).
At this point I’m just living with accountsd getting larger, but more slowly. In about a week’s time it’s large enough that it’s impacting memory usage and causing swapping. So I kill it and it starts again.
I’m working through another issue with HomeKit and Apple. I have a case open and trying to resolve a problem where I can’t share my Homekit Home settings with my family. Been a problem for 4 years, through many releases. Now I have Apple engaged, but in truth that ship has sailed as I’m starting to move everything to Amazon Alexa (though I’d prefer not to).
Once the HomeKit issue is resolved, I’m going to open an official case with Apple and force them to review, log and address my issue.
Another poster on Apple Forums said they wrote a script that just killed the accountsd process every time it got larger than a certain size. I think that will work as well.
If you’re using your Mac and you hear the fans start spinning and stay on, open Activity Monitor, search for the process “accountsd” and terminate (kill) it. It will restart so no harm done, but it will also release all that memory and your fans will stop spinning.