PNW Guy

Q: Mail: everything is (now) working, but CPU constantly pegged

MacBook Pro (Retina 2014)

Just updated to El Capitan 10.11 last night

4 Mail accounts: 1 Exchange, 2 Gmail IMAP, 1 iCloud

 

After some initial warts with Mail acting glitchy,* it now appears to be working usably for me.  I can send and receive email on all 4 accounts, and otherwise haven't noticed any functional problem.

 

However, Mail is clearly broken, because it's constantly using > 100% of the CPU as displayed in Activity Monitor, with an excessively high number of Unix System Calls in the Statistics tab.  Even when only running for a few minutes, this counter is already 192,432,733.  This clearly can't be right.  CPU Time and Context Switches are also going bananas.  One possible clue is that in the menu bar on the left (or in the detached Activity window), it is constantly displaying "Downloading Messages 35 of 35".  The number of outstanding messages always starts at 8 when I first launch Mail, and remains stuck here.  Each time I check for new messages, it will increment by 3 (8 --> 11, 11 --> 14, ...).  It never goes down.  Note that new messages do actually appear to come in and go out without an issue, but these "Downloading Messages" indications never decrement and never disappear.  I suspect there is an unbounded loop in there somewhere driving up the CPU.  Consequently, it's a permanent resident in the Apps Using Significant Energy display, and crushing my battery.

 

I have used Activity Monitor to collect a Sample of Mail, and I've looked at it a bit, but really I need the Mail engineers to review it and comment.

 

* Other issues I had:

  • App was open and partially working - menu wouldn't respond (quitting and restarted fixed it).
  • I had two copies of my Exchange account - one enabled and one disabled, and one of them did not have all the applications enabled.  I deleted the duplicate.
  • Mail initially showed > 10,000 emails it was downloading - seem to go through this mega crush on every Mail upgrade

MacBook Pro with Retina display, OS X El Capitan (10.11)

Posted on Oct 1, 2015 9:23 AM

Close

Q: Mail: everything is (now) working, but CPU constantly pegged

  • All replies
  • Helpful answers

  • by PNW Guy,Solvedanswer

    PNW Guy PNW Guy Oct 1, 2015 2:47 PM in response to PNW Guy
    Level 1 (9 points)
    Mac OS X
    Oct 1, 2015 2:47 PM in response to PNW Guy

    I was able to figure this out and fix it myself.  Long story short: I tracked it down to my Exchange account being enabled.  The only fix was to delete the entire Exchange account (calendars, etc.) from the Internet Accounts in Settings, then create it again from scratch.  Everything is working fine now (didn't lose any email - it's all on the Exchange server), and the CPU/Energy impact of Mail is where it should be.

     

    Also note, during this problem I found that Gigabytes of space were being wasted writing hundreds of errors/second to ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/2015-10-01_EWSBodyFe tch.log  I zero'd out that file and reclaimed 10's of Gigs.

     

    Also, since we're fixing problems with Apple... for anyone who was seeing countless postfix errors binding to IPv6 loopback address, you *can* edit your postfix/main.cf, but I think that's the wrong solution; better to remove fe80::1%lo0 from /etc/hosts, leaving only:

     

    127.0.0.1 localhost

    255.255.255.255 broadcasthost

    ::1             localhost

  • by GerardFromUlrum,

    GerardFromUlrum GerardFromUlrum Oct 20, 2015 4:07 AM in response to PNW Guy
    Level 1 (35 points)
    Oct 20, 2015 4:07 AM in response to PNW Guy

    Thanks for this.

    Had the same problem, ± 120% CPU all the time.

    Deleted and re-entered an Exchange account and all problems seem to be gone now.

     

    Sigh, why does the world still tolerate that bloatware...