Resolved Solved: Mail slowing down to molasses - constant 105% CPU

Discussion in 'OS X Mavericks (10.9)' started by RedTomato, Nov 23, 2013.

  1. RedTomato, Nov 23, 2013
    Last edited: Nov 26, 2013

    RedTomato macrumors 68040

    RedTomato

    Joined:
    Mar 4, 2005
    Location:
    .. London ..
    #1
    In general Mavericks is running reasonably well, though I don't find it as big of an upgrade as Mountain Lion was.

    I clean-installed my 2009 Macbook with Mountain Lion about 10 months ago, (after a long-term Snow Panther install began to slow down under the weight of cruft) and it was running beautifully. Then I updated to Mavericks and I sort of wish I had waited longer.

    A lot of apps were stalling, and I fixed that by turning off App Nap on my most commonly used apps. Mail.app started off reasonably well, but over the weeks has become more and more slow. It now cannot keep up with my typing - letters appear several seconds after I type them, windows take several second to refresh etc - all this is driving me insane. It only happens within the Mail app. All other apps are fine.

    I only run a single IMAP Gmail account. I had other accounts but deleted them in the hope of speeding up Mail as I don't really use them.

    Activity Monitor is showing mail constantly using 90-100% CPU, but I can't tell what it's doing. I've left the macbook on all day for several days in the hope it would finish then settle down, but nothing. The Mail in-app Activity window is blank. It shows any occurring downloading / sending mail /etc activity as normal.

    I installed a few weeks ago the recent Mail Update from Apple, but it hasn't helped. In fact I think the slowdown has become worse.

    Any help?

    I filtered the Console log for items linked to Mail:

    Code:
    23/11/2013 13:22:33.483 WindowServer[122]: disable_update_timeout: UI updates were forcibly disabled by application "Mail" for over 1.00 seconds. Server has re-enabled them.
    23/11/2013 13:22:33.978 WindowServer[122]: common_reenable_update: UI updates were finally reenabled by application "Mail" after 1.50 seconds (server forcibly re-enabled them after 1.00 seconds)
    23/11/2013 13:22:43.926 WindowServer[122]: disable_update_timeout: UI updates were forcibly disabled by application "Mail" for over 1.00 seconds. Server has re-enabled them.
    23/11/2013 13:22:48.622 WindowServer[122]: common_reenable_update: UI updates were finally reenabled by application "Mail" after 5.70 seconds (server forcibly re-enabled them after 1.00 seconds)
    23/11/2013 13:27:44.533 mdworker[11034]: (Warning) Import: pre-plugin uti:com.apple.mail.emlx plugin:/Library/Spotlight/Mail.mdimporter uuid:142C071E-A837-11D8-A224-0003930A8D8C 1822 exceeded I/O use limits (1) after 7033 milliseconds sizing:0 - find suspect file using: sudo mdutil -t 28700740
    23/11/2013 14:12:57.749 WindowServer[122]: disable_update_timeout: UI updates were forcibly disabled by application "Mail" for over 1.00 seconds. Server has re-enabled them.
    23/11/2013 14:12:57.752 WindowServer[122]: common_reenable_update: UI updates were finally reenabled by application "Mail" after 1.11 seconds (server forcibly re-enabled them after 1.11 seconds)
    23/11/2013 14:14:10.269 Mail[8345]: [WEB BUNDLE] Could not execute script: ReferenceError: Can't find variable: MUIWebDocumentDisplayController_sharedInstance
    23/11/2013 14:36:34.913 mdworker[11156]: (Normal) Import: Using too many resources after 1408 files (wired: 0 resident: 44873 swapped: 0 regions: 2070), hit usage threshold importing /Users/xxxxx/Library/Mail/V2/IMAP-xxxxx.xxx@imap.gmail.com/[Gmail].mbox/All Mail.mbox/3B3597DB-EAA3-44C1-9791-CED66B353396/Data/2/4/1/Messages/142134.emlx, exiting to clean up now.
    23/11/2013 14:43:43.230 mdworker[11162]: (Normal) Import: Using too many resources after 1536 files (wired: 0 resident: 3887 swapped: 0 regions: 2072), hit usage threshold importing /Users/xxxxxx/Library/Mail/V2/IMAP-xxxx.xxxx@imap.gmail.com/[Gmail].mbox/All Mail.mbox/3B3597DB-EAA3-44C1-9791-CED66B353396/Data/5/4/1/Messages/145191.emlx, exiting to clean up now.
    23/11/2013 14:48:05.419 mdworker[11163]: (Normal) Import: Using too many resources after 1536 files (wired: 0 resident: 3855 swapped: 0 regions: 2068), hit usage threshold importing /Users/xxxx/Library/Mail/V2/IMAP-xxx.xxxx@imap.gmail.com/[Gmail].mbox/All Mail.mbox/3B3597DB-EAA3-44C1-9791-CED66B353396/Data/9/3/1/Messages/139774.emlx, exiting to clean up now.
    23/11/2013 15:09:00.650 Mail[8345]: [WEB BUNDLE] Could not execute script: TypeError: 'undefined' is not a function (evaluating 'e.getBoundingClientRect()')
    23/11/2013 16:29:05.845 Mail[8345]: open on /Users/xxxx/Library/Mail/V2/Mailboxes/Deleted Messages.mbox/3B3597DB-EAA3-44C1-9791-CED66B353396/Data/5/1/2/Messages/215009.emlx: No such file or directory
    23/11/2013 16:49:06.937 WindowServer[122]: disable_update_timeout: UI updates were forcibly disabled by application "Mail" for over 1.00 seconds. Server has re-enabled them.
    23/11/2013 16:49:07.071 WindowServer[122]: common_reenable_update: UI updates were finally reenabled by application "Mail" after 1.14 seconds (server forcibly re-enabled them after 1.00 seconds)
    
     
  2. satcomer macrumors 603

    satcomer

    Joined:
    Feb 19, 2008
    Location:
    The Finger Lakes Region
    #2
    Open System Preferences->Internet Accounts and check out your Gmail account and tell use how many syncs with Google you have!!!

    Plus go into your web Gmail email account and look for the gear icon in the top right corner and use that to go to 'Settings'. In Settings click on 'Labels' and uncheck the most of the boxes not to show.

    Then back in OS X Mail Preferences, click on the mini-tab for (in the Gmail account) 'Mail Box Behaviors' . In there don't show Deleted items and keeps sent Mail on server for only a week. Then if you to save sent email then save them to a folder on your Mac, to save time syncing to Google.

    Lastly in Mail go Mail's menu item 'Window'. In the drop-down use the Connection Doctor. Then in the Connection Doctor click the 'Show Detail' and that will print out Mail's connection to the Gmail server.
     
  3. RedTomato thread starter macrumors 68040

    RedTomato

    Joined:
    Mar 4, 2005
    Location:
    .. London ..
    #3
    Problem solved!

    Thanks satcomer for your very helpful reply.

    Taking your suggestions in reverse order:

    4: Connection Doctor showed everything more or less working fine. gmail SMTP sending wasn't going through so Mail was using a different SMTP account to send. Getting a new gmail password for the SMTP sending (I use google's 2-factor auth) sorted that out. Everything fine there now, but still high CPU usage.

    3. Deleted items behaviour can't be changed in my Mavericks Mail.app. I tell google never to delete my Sent items as they are important to me to keep. I move the previous year's sent items to a local mailbox on my Mac about once a year.

    2. Already done.

    1. Internet Accounts - this was where the solution lay - I have :

    iCloud - syncs Contacts, Calendar, Reminders, Safari, Keychain, BTMM, FMM
    Gmail 1 - Mail
    Gmail 2 - Calendar, Notes
    Facebook - Calendar (part of my work is through Facebook)

    Yes, 2 Gmail entries - both go to the same account. This was recommended as a workaround by Joe Kissell in Tidbits a few years ago as a workaround for some Apple / Gmail oddities.

    I noticed Gmail 1 was throwing a password error in System Prefs even through my Gmail was working fine. On investigation I found that I had some time ago set up a send-email-as-xxx alias address in Gmail. It worked before but now in Mavericks System Prefs was trying to log into Gmail using this alias, not the correct user name.

    I don't use the alias much nowadays so I deleted it from Mail.app. BINGO. System Prefs was now able to log into Gmail, and it merged both the Gmail entries into one.

    I closed & opened Mail.app and it shuffled around a few thousand changes then went back to normal - low to zero CPU usage. Thanks!

    I suspect that as sys prefs/ internet accounts couldn't log into Gmail, for some reason Mail.app was building up a gigantic temporary cache/log of changes to send back to gmail. Every time I used mail, this cache was being added to, so even though I could download and send email, this cache wasn't being cleared. So mail.app gradually slowed down over time.

    Sorting out the sys prefs login let mail.app finally sync and clear this cache and speed up.

    Makes sense?

    Thanks again

    RedTomato

     
  4. satcomer macrumors 603

    satcomer

    Joined:
    Feb 19, 2008
    Location:
    The Finger Lakes Region
    #4
    In Mail open Mail and go back to Mail's Preferences, Accounts pane. Their click on your Gmail account and in the 'Account Information' section down the window there will be a toggle bar for 'Outgoing Mail Server (SMPT): and use that bar to select 'Edit SMPT Server lists'. In the pop-up make sure you Google server is highlighted. See if that helps.
     
  5. RedTomato thread starter macrumors 68040

    RedTomato

    Joined:
    Mar 4, 2005
    Location:
    .. London ..
    #5
    Sorry if it wasn't clear in the wall of text above, but yes it has all been resolved.

    BTW: yes Gmail was using Google's STMP send, but in Mac/Sys Prefs/Internet Accounts/Gmail, OSX was trying to log onto Gmail with an email alias address which was failing. Deleting the alias cleared everything up and Mail.app was able to finish all its filing.

    For others who need the send-as functionality, I suggest deleting the alias, wait for Mail to sort itself out, then recreate the alias again.

    Note: In Mail prefs the alias was listed first, because several years ago I followed Google's instructions on how to set the alias to be the primary send-as address. That might have been why SysPrefs/Internet Accounts/Gmail was failing, impacting Mail.app's operations.

    Obviously both Gmail and Mavericks Mail have now changed since Google issued these instructions.

     
  6. DoFoT9 macrumors P6

    DoFoT9

    Joined:
    Jun 11, 2007
    Location:
    Singapore
    #6
    RedT: I'm sorry to bring this tread back, but I've come across this for a friend over the past few weeks. Internet research has shown that apparently, 10.9.2 "fixed" these occurrences, but apparently not - it still happens on 10.9.3.

    The errors aren't coming through in Mail, they're quite random actually - it seems that the error message is generic and not signifying the real cause of the fault.

    It does appear to be a particular application causing the slow downs, due to coding bugs, perhaps something similar to this, from the developer of an active app. I am by no means a coder, but it may make sense for a scenario such as this.

    There are many alternate causes of this problem - and resolutions, some even mentioning GPU switching issues between Intel & discrete.

    Just posting to see if anybody has troubleshooting techniques that may assist beyond what I've already researched.
     
  7. rdj macrumors newbie

    Joined:
    Dec 26, 2007
    Location:
    Virginia
    #7
    Reviving thread to note that it's still happening with Mavericks 10.9.4. It is less likely to be due to a problem with a particular application than something within the system. That could be within the operating system itself – the stuff that Apple builds and maintains as the "core" of OS X – but more likely, it's due to the presence of some type of "legacy add-on" software (plug ins, extensions, etc.) that many of us have installed on our systems but not everyone does.

    My guess is that it's less likely to be something internal to OS X than it is some characteristic that "older" systems might have –*or newer systems being used by "older users" who have stuff installed that others might be less likely to have.

    Otherwise, everyone would be having this problem, and evidently they're not.
     

Share This Page