Apple’s Worldwide Developers Conference to kick off June 10 at 10 a.m. PDT with Keynote address

The Keynote will be available to stream on apple.com, the Apple Developer app, the Apple TV app, and the Apple YouTube channel. On-demand playback will be available after the conclusion of the stream.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

10.11, Mail.app Memory Leak?

About 24 hours after upgrading to OS 10.11 (el capitan), Mail.app had essentially used up all available system memory bringing up the "Your system has run out of application memory" dialog and necessitating force quitting Mail.app. Since that initial force quit, Mail.app will reliably repeat this cycle when force quit and restarted — it works for about 5-10 minutes while it gobbles up RAM (apparently reading disc and dumping directly into RAM as the bytes read from disc in activity monitor initially correlate closely with the memory used). System reboot didn't break the pattern. I don't have any extensions installed in Mail...


Any thoughts? Feels like a memory leak. I can't imagine what its reading from disc - 120 gb is a substantial chunk of my hard drive...so, it seems it must be doing something repetitive...

User uploaded fileUser uploaded file

MacBook Pro with Retina display, OS X El Capitan (10.11), stock machine, no add-ons.

Posted on Oct 2, 2015 5:41 AM

Reply
79 replies

Nov 8, 2015 5:34 AM in response to miguel.apple

I had followed Linc's suggestion, and removed all mail accounts. Incredibly, with NO active mail accounts, on launch Mail nonetheless rapidly hogged memory and was at 18Gb within 1 minute. With no active mail accounts and no emails. Deleting the log folder, as suggested by Miguel and Luigino, worked for me. Mail launched and held steady at ~34Mb with no active mail accounts and no emails then slowly grew as I added mail accounts and emails were downloaded. After adding 3 accounts and allowing time for folders to sync, memory use ~= 260Mb. No runaway memory leak. Yay!

Many thanks for the help!

Nov 11, 2015 9:47 AM in response to epikeia

I have finally solved my issues with El Capitan Mail app and (in my case) Exchange Servers.

This is what I have discovered;


The problem:

Mail app at El Capitan create massive debug logs at ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/

The debug log it's not running all the time, only sometimes start a crazy loop, that you can't stop anyway, it's doesn't matter if you close the app, because it will continue next time you open Mail.

When the issue it's happening the Mail app processor use it's over 100% and the file XXX_IMAPSyncActivity.log starts to grow up to the infinite.

When the file it's too big, Mail tries to archive and zip the file, and this eats all your ram memory.

At this time you computer it's completely lost, and your only option it's to force kill Mail app or a hard reset.

If you open Mail again the process will remain at the last point and you will lose your computer again.

At this time you can remove all log and zip files at ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/ restarting the process from the beginning.

It doesn't matter if you activate, deactivate, delete, reconfigure, rebuild or whatever you want to do with the conflictive account.

it doesn't matter if you do a clean install of El Capitan and start from zero.

Soon or later the log will eat all your resources, your processor, your disk and your ram and you will lost your computer control again.


My solution:

Probably you need to uncheck first:

Mail --> preferences --> accounts --> Mailbox Behaviors --> Move deleted messages to the Trash mailbox

And after that, disable:

Mail --> preferences --> accounts --> Advanced --> Compact mailboxes automatically


I have seen that when Mail tries to compact the mailbox with Exchange Servers the process doesn't work as expected and loops an indefinitely error.

The debug and log of this error it's what in my case created all my problems with Mail.

Disabling the automatic compact mailbox for my exchange account I have had no more issues with the Mail app at El Capitan.


I hope this help others with the same problem, and Apple programmers to definitelly solve the problem in a next update.

Nov 12, 2015 1:35 AM in response to jcw289

Hi, our company Exchange Server it's very very old, (it's the unsupported 2003 version), and the only way I can use it on a mac is with IMAP, I don't think the problem it's with all IMAP configurations because I don't have any problems with other IMAP accounts (gmail for example) in my home computers.


In my case, the compact option it's greyed out if I don't disable first Mail --> preferences --> accounts --> Mailbox Behaviors --> Move deleted messages to the Trash mailbox.


If on "real" Exchange accounts (EWS log files) that option it's not present I would try to configure the account with IMAP and disable the move deleted messages to trash and compact mailboxes. It's not perfect, but I have been having the problem with Mail from the first day I updated to El Capitan, I tried all possible things, and suggested previous solutions, I made a clean install of El Capitan and configuration from zero, and nothing solved, until I unchecked the sent to trash, and after that the compact mailboxes. With that configuration I have had no more problems and my job iMac 24 2008 (with ssd) goes like my home mac book pro retina 2014, very very fast and without any problems 😉


This is the full configuration working for me:

User uploaded file


User uploaded file

Nov 18, 2015 2:14 AM in response to JimRobertson

Hi everyone,

Just an update. Have tried all solutions proposed here, combined or individually, and sadly the issue keeps coming back.

Deleting the log files / and deleting-reinstalling the problematic account works but not for long and the problem shows again after a couple of minutes now (before was a couple of days).

My problem is one precise IMAP account that keeps stacking log entries in my log file at a staggering speed and the log file ramps up to many GB in matters of minutes.

If anyone has a clue that would be appreciated.


Thanks


Chak

Nov 18, 2015 3:34 AM in response to Chakdag

One more tip, if you open the activity monitor app probably you will see your cpu use very high due to the crazy log creation.

Try to disable all Mailbox Behaviors checkboxes and play with the checkboxes at the advanced tab, when the problem is solved the processor inmediatelly goes to the normality.

If nothing works try to disable the account, if this doesn't stop burning the processor that is not the problematic account, so try disabling the other accounts until your processor goes to normality.

First of all, go to windows, inspector connexion and be sure the registry activity it's disabled, click on show registries, close Mail and remove all files from the opened folder in finder, because if Mail it's trying to zip the log the processor would be crazy too.

If after all doesn't work try to open Terminal and type

cd ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/

ls -la

look at the problematic log file name and type something like this:

tail -f 2015-11-18_IMAPSyncActivity.log

you will see live the crazy log creation

to stop the tail command press ctrl + c (not cmd)

try to understand the error message it's being repeated constantly

if you want you can share here the error message.

I hope you have luck.

Best

Lork

Nov 18, 2015 12:05 PM in response to epikeia

The solutions proposed in this thread seem to be from people more expert than I, but I have found an easy one that works for me to solve the mail memory leak that eats all RAM. The memory leak in Mail is obvious when you watch it happen on "Activity Monitor" program found in your utilities. I tried many fixes from all over the net and none worked. Finally I ran Onyx a free mac program that runs a lot of the normal cleanup routines that you can access in terminal. This has completely fixed the problem for the last 24 hours. I've used this software for many years through all its updates on 8 or 10 different Mac's without any problems.

Nov 19, 2015 8:07 PM in response to sergikkio

Thank you! Best answer! I removed that com.apple.mail folder as you suggested and no more memory leak (at least for the moment). I only had to reset up my prefs for the app, but that's a small price to pay for these great benefits:


  • Better battery life
  • Mail that actually works for more than 5 seconds
  • An OS that doesn't run out of memory in 60 seconds
  • MMMMMMmmmmm happy MacBook Pro....


-JE

10.11, Mail.app Memory Leak?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.