5

For some time now, Mail.app takes three minute or more to display its window, and for that interval, is labeled "not responding." There are several things that are related somehow:

  1. During that interval, fseventsd consumes 82%±3% of CPU.
  2. If we run /usr/sbin/repairHomePermissions, Mail launches normally, but the fix only lasts a couple of days.
  3. If we rebuild mailboxes, it is not fixed; if we remove all the IMAP accounts and reinstall them, it is not fixed; but if we rebuild mailboxes after that reinstall, it is normal, but again, only for a day or two.
  4. If we remove everything from /Library/LaunchDaemons, and reboot, it works normally. Did that today, so I don't know yet how long it will last.

Here is what was in LaunchDaemons:

com.acapelagroup.iVoxHelper.plist
com.adobe.ARMDC.Communicator.plist
com.adobe.ARMDC.SMJobBlessHelper.plist
com.apple.installer.osmessagetracing.plist
com.barebones.authd.plist
com.malwarebytes.HelperTool.plist
com.malwarebytes.mbam.rtprotection.daemon.plist
com.malwarebytes.mbam.settings.daemon.plist
com.oracle.java.Helper-Tool.plist
com.paragon-software.installer.plist
com.paragon-software.ntfs.loader.plist
com.paragon-software.ntfsd.plist
com.prey.agent.plist
homebrew.mxcl.dnsmasq.plist
homebrew.mxcl.mysql.plist
homebrew.mxcl.unbound.plist
org.macports.rsyncd.plist

I believe all of that has been around for longer than the problem. I recently got a new 2019 MBP with Catalina, upgraded to Big Sur, and used Migration Assistant to bring everything in from a 2012 MBP with Catalina. This problem never occurred on the old MBP, and I think (not certain) that it did not start immediately on the new one. I'm fairly sure I used it for weeks before this started happening.

Ideas? It's going to take two days to find out whether removing some LauchDaemon is a permanent fix, and if so, weeks to figure out which one. And it would still be a mystery how it interacts with permissions and mailboxes.

fseventsd is known to suck up CPU for Time Machine, but this problem has happened with Time Machine turned off and when the TM disks aren't even plugged in. And opening Mail should be making roughly the same disk actions each time it is launched.

https://arstechnica.com/gadgets/2007/10/mac-os-x-10-5/7/

https://discussions.apple.com/thread/1502226

Another oddity (but I think it's unrelated) is that Photos.app is allegedly using a lot of energy when the Dock, ps -ef, and Activity Monitor all say Photos is not running. (Though sometimes, photoanalysisd appears in Activity monitor briefly.)

UPDATE: After an O.S. update, most of the time, Mail opens instantly, and when it doesn't, the delay is only a few seconds (never the five-plus minutes from before). However, once in a while, for no obvious reason, a Finder action seems to take minutes!

5
  • I would probably set up a new Mail account for testing with some limited and basic emails. This is starting to look like the Mail you downloaded ( which would mean a slow launch with no network) or the servers slow to respond ( fast launch with no network ).
    – bmike
    Feb 6, 2021 at 0:09
  • If it is due to the quantity of Mail, then (1) nothing would make it launch instantly for a day or two and then get slow again; (2) it wouldn't have started suddenly after working fine through all the previous months. And the none of the temporary fixes in anyway changed the network functions.
    – WGroleau
    Feb 6, 2021 at 3:04
  • It’s almost certainly your mail data. 1) your IMAP server and network will vary in speed 2) that’s the nature of things breaking - first they work, then they don’t. - I’ll make a proper answer so I can expand on things. Do you have AppleCare or a business sales contact at Apple?
    – bmike
    Feb 6, 2021 at 3:15
  • The Apple Care guy keeps finding articles for different things to try. At least he understands what he’s reading, unlike the tech support in some places. It’s a bit too much coincidence for seemingly unrelated things done on the Mac to magically speed up the IMAP server in another state.
    – WGroleau
    Feb 6, 2021 at 8:15
  • 1
    I also have this problem and I am very curious where these adventures eventually took you. Did any diagnosis ever pan out here?
    – Glyph
    Jul 9, 2021 at 6:52

4 Answers 4

3

Let’s see what Mail is doing:

  1. Run the following Terminal command to enable kernel symbolication: $ sudo nvram boot-args="keepsyms=1"
  2. Reboot your machine and don’t open any apps except for Terminal.
  3. Open Mail and wait a few moments for it to reach its steady-state unresponsiveness.
  4. Run the following command in Terminal, making sure you’re only running it during the window of time that Mail is unresponsive: $ sudo spindump -reveal -noProcessingWhileSampling
  5. After waiting for 10 seconds to collect a sample and another minute or two to symbolicate and format, you’ll get a file in /tmp/spindump.txt that contains a stackshot of every process.
  6. Upload the file to PasteBin or some equivalent place and we can take a look to see what Mail’s main thread is blocked on.
10
  • This is a great technique to avoid needing Inspector app to look at things. The sysdiagnose path is so heavy weight.
    – bmike
    Feb 6, 2021 at 16:16
  • This sounds like a good one. Last time I looked (with all the LaunchDaemons gone), it was only taking three or four seconds to open, but if it keeps slowing down, I can try this. The Apple guy is supposed to call back Monday, but I can throw darts as well as he can.
    – WGroleau
    Feb 6, 2021 at 16:53
  • I'm having this problem with Mail and tried running the sudo nvram command in the first step but got an error: nvram: Error setting variable - 'boot-args': (iokit/common) not permitted any suggestions?
    – msridhar
    Jul 15, 2021 at 19:59
  • 1
    @msridhar You need to first disable SIP
    – pion
    Jul 15, 2021 at 20:00
  • 1
    @msridhar A spindump is a normal text file so feel free to examine it in any text editor. You will see that the bulk of its contents is simply comprised of function call stacks for each thread of each running process on your system. The reason why you don’t want to omit parts of it is because most processes make system and IPC calls, which are serviced by other processes. In turn, other processes also make such calls and/or may be hung or slow themselves. You need to see all processes at once in order to not miss anything.
    – pion
    Jul 29, 2021 at 18:34
1

I had this problem as well and as a bit of a last resort, I actually installed CleanMyMac X to see if they had any recommendations. I'm normally extremely wary of this sort of ambiguous "cleanup" software after the CCleaner fiasco (and some of the stuff CleanMyMac suggests doing looks insanely dangerous from a developer perspective, like randomly deleting portions of applications like localization files and alternate architectures; I need to learn why this doesn't instantly break code signatures & gatekeeper).

But I digress. I tried their "mail attachments" cleanup and … suddenly Mail.app launches within seconds again. I think you can do this yourself by manually clearing out your "Mail Downloads" folder. I think there might be multiple causes for launch slowness but this did reliably fix mine.

6
  • 1
    Several episodes of "try this" didn't work, and finally one fixed it—temporarily. But then an O.S. upgrade seems to have mostly fixed it. Mail usually opens immediately, but once in a while it takes five or ten seconds.
    – WGroleau
    Jul 9, 2021 at 7:26
  • @WGroleau Thanks. I'm definitely all the way upgraded on the OS and it didn't help. It seems like the issue is that Mail uses FSEvents to subscribe to a huge number of different locations, and any of them might get clogged up with temp files, "Mail Downloads" just being one.
    – Glyph
    Jul 10, 2021 at 23:15
  • I'm curious what the deal with the downvote is, whoever did that — were my instructions unclear, or is the perception that this is a product recommendation the problem? This was a really straightforward way out of a particular instance of this situation, at least.
    – Glyph
    Jul 10, 2021 at 23:16
  • 1
    FWIW this did not work for me. (Downvote was not from me)
    – msridhar
    Jul 29, 2021 at 18:04
  • Thanks @msridhar. Have you also tried clearing the envelope index? I did that a few times before Trying the "mail attachments" route so perhaps both are necessary?
    – Glyph
    Jul 30, 2021 at 22:54
0

Check if you have any Mail plugins installed (Mail > Preferences > General > Manage plugins).

If so, disable them and restart Mail to check if Mail's launch time goes back to normal. If that is the case, quit Mail, remove all Plugins from /Library/Mail/Bundles and restart Mail. Then reinstall the plugins.

In my case, this procedure fixed the launch time issue (on my MacBook Pro 2021, launch time changed from over 30 seconds to instantly).

1
  • Don’t have any. But the problem seems to have gone away long ago. (Some time after weeks of trial and error from Apple failed to fix it.)
    – WGroleau
    Jan 9 at 17:26
-3

It’s almost certainly your IMAP server and the specific data it delivered to your Mac, but let’s first isolate other easy tests as follows.

  1. Make a brand new user account on the mac.
  2. Make a brand new email account on your provider(s) of choice.

Test with the new user account and new email accounts. This will tell you if mail is broken, the system is broken or the provider is broken.

Most of the time, it’s not those things and is related to the actual mail content being downloaded and synced and speed of the IMAP provider, but those are very hard to dissect and troubleshoot so I start with the easy steps first. Keep notes, since if you need to work with your provider - they will avoid having to repeat those tests or make it quick to rule out your Mac or your mail program or the OS.

5
  • 1
    The mail has already been downloaded when the problem occurs.
    – WGroleau
    Feb 6, 2021 at 8:15
  • It's a bit of a stretch to think that an IMAC server in San Francisco would slow down the day I start using a newer MacBook.
    – WGroleau
    Jul 9, 2021 at 7:28
  • That’s great. Note imap almost always runs on unix, en.wikipedia.org/wiki/Internet_Message_Access_Protocol and did you do any of the measurements to try and corner or isolate the issue or was being a good aim with darts, sufficient to solve this @WGroleau ? The point about server is that all the data Mail might ever display or process comes from another machine so network and data isolation are usually needed for tuning this issue. Perhaps yours isn’t a common problem.
    – bmike
    Jul 9, 2021 at 11:18
  • Launching Mail does not block on remote IMAP access, only on the local database & filesystem. A slow IMAP server might make it take a long time for certain messages to download, but that's not the problem being described here. (Also, this is a bit of a tangent, but "IMAP" does not always run "on UNIX", it's an internet protocol, the software that speaks it runs on pretty much every platform that can connect to the Internet.)
    – Glyph
    Jul 12, 2021 at 6:57
  • And since I said that deleting all mail account, re-creating, and downloading everything again fixes the problem temporarily, it must be something MacOS does after download. None of the guesses the Apple engineers asked me to try helped, but some (long) time after the AppleCare guy falsely declared it resolved, it stopped happening.
    – WGroleau
    Jan 9 at 17:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .