epikeia

Q: 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...

memory.jpgdisc.jpg

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

Posted on Oct 2, 2015 5:41 AM

Close

Q: 10.11, Mail.app Memory Leak?

  • All replies
  • Helpful answers

Previous Page 2 of 6 last Next
  • by Luigino il Pazzo,

    Luigino il Pazzo Luigino il Pazzo Oct 7, 2015 12:28 AM in response to epikeia
    Level 1 (0 points)
    Oct 7, 2015 12:28 AM in response to epikeia

    Followed Linc Davis' instructions and found that it solved the problem. However, I knew that I didn't have to move the Mail folder as I had tried that earlier with no luck.

     

    Once the same problem happened on two other computers I narrowed it down to one of the steps in the previous solution. Simply go to the user's library and delete:

        Containers/com.apple.mail

    That seems to sort it.

  • by miguel.apple,Helpful

    miguel.apple miguel.apple Oct 7, 2015 3:50 AM in response to Luigino il Pazzo
    Level 1 (30 points)
    Oct 7, 2015 3:50 AM in response to Luigino il Pazzo

    Same as this one Mail on El Capitan

     

     

    I find that the new Mail app in El Capitan is trying to clean up the log files by zipping them in memory which caused the problem.

     

    Try to delete your log file manually in the following folder (Command + Shift + G):

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

     

    You may see huge size log files in the folder ...just delete all *.log and restart your Mail App. Then, things should back to normal

  • by mdc011,

    mdc011 mdc011 Oct 7, 2015 4:27 AM in response to miguel.apple
    Level 1 (0 points)
    Oct 7, 2015 4:27 AM in response to miguel.apple

    Never Posted before - But after 3 days trying to fix the Mail app that was hogging all the memory on my Mac making it unusable. - This finally fixed it !

    Many thanks Luigino and Miguel .

  • by JoseLuisPhoto,

    JoseLuisPhoto JoseLuisPhoto Oct 7, 2015 7:25 AM in response to miguel.apple
    Level 1 (0 points)
    Oct 7, 2015 7:25 AM in response to miguel.apple

    LIFESAVER!!!!  miguel.apple advice worked like a charm!  Thank you, Thank you!

  • by Carl Youngmann,

    Carl Youngmann Carl Youngmann Oct 7, 2015 10:34 AM in response to miguel.apple
    Level 1 (0 points)
    Mac OS X
    Oct 7, 2015 10:34 AM in response to miguel.apple

    WOW! This did the trick! Thank you so much.

     

    I so much DID NOT want to have to export all of my mailboxes and re-import them.

     

    This answer should be at the top of the list.

     

    Thanks again.

  • by Chakdag,

    Chakdag Chakdag Oct 8, 2015 5:10 PM in response to Luigino il Pazzo
    Level 1 (10 points)
    Oct 8, 2015 5:10 PM in response to Luigino il Pazzo

    Luigino's solution worked perfect for me.

    Haven't tried Miguel's as my log files seemed to have normal sizes (a couple of Mb for the biggest).

    Thanks guys

  • by JimRobertson,

    JimRobertson JimRobertson Oct 9, 2015 7:53 AM in response to miguel.apple
    Level 1 (1 points)
    Oct 9, 2015 7:53 AM in response to miguel.apple

    Just curious. Your suggestion seems to have worked for me as well. However, after clearing all these log files, I find they're accumulating again With mail running in the background on my laptop for about an hour, the largest of them (which contains "EWS" in its filename, so must be from my Exchange account), is already 4.45 GB in size (during this time I've sent one message and received one via my Exchange Account (our server is Windows Small Business Server 2008 running Exchange 2007). So, two questions:

     

    1. Have you (or any other thread participants, seen these log files grow this rapidly after they've been deleted?

    2. Has everyone afflicted by this issue had an Exchange email account configured in Mail.app (better to phrase this "has anyone who doesn't have an Exchange  account experienced this issue?

     

    Thanks so much!

  • by atetheapple,

    atetheapple atetheapple Oct 9, 2015 9:51 AM in response to miguel.apple
    Level 1 (0 points)
    Oct 9, 2015 9:51 AM in response to miguel.apple

    Thank you. This simple suggestion solved my problem immediately.  The mail app was making my map unusable.  The activity monitor showed the mail app was using nearly 70 gb. As soon as I did this fix its back to 100 mb and the computer all around seems to run faster in nearly every app.  Is this something I should do periodically, and are there other .log files for other apps that will clean and speed up my mac even more?

  • by JimRobertson,

    JimRobertson JimRobertson Oct 9, 2015 3:06 PM in response to JimRobertson
    Level 1 (1 points)
    Oct 9, 2015 3:06 PM in response to JimRobertson

    Three other observations since I followed miguel.apple's advice:

    1. On my laptop that is running OS X 10.11, the file that's been mushrooming in size is 2015-10-09_EWSBodyFetch.log.
    2. If I take my Exchange account offline, that log file stops growing.
    3. On the machine running El Capitan, if the Exchange Account is active, the 3-pane default message window in Mail.app displays "Downloading Messages" continuously at the lower left corner of the screen, with the same numerator and denominator; e.g., "Downloading Messages" 104 of 104. That message disappears when I take the Exchange Account offline, and it's not present on my machine that is still running Yosemite.
  • by JimRobertson,

    JimRobertson JimRobertson Oct 10, 2015 8:46 AM in response to Chakdag
    Level 1 (1 points)
    Oct 10, 2015 8:46 AM in response to Chakdag

    Chakdag wrote:

     

    Luigino's solution worked perfect for me.

    Haven't tried Miguel's as my log files seemed to have normal sizes (a couple of Mb for the biggest).

    Thanks guys

    I've been "investigating" (more like fumbling in the dark, since I don't know much about what I'm doing beneath the surface of the Mac GUI), but I've discovered several things:

    Although deleting the log files brought mail back to life temporarily, the contents of the log folder pointed out by Miguel immediately started to grow again, reaching several GB within an hour!

    Several things suggested my problem lay in my Exchange mail account, and, curiously, there was NOT a problem with that same account on another Mac still running Yosemite. Among these:

    • If I took the Exchange account offline, the log files stopped growing immediately.
    • The file growing so rapidly was named 2015-10-10_EWSBodyFetch.log (EWS is an abbreviation for Exchange Web Services)
    • If I looked at that file in Console while the Exchange account was offline, it had been collecting literally hundreds of iterations of the same message per second, to wit;
    • Oct 10 07:27:52  Mail[5157] <Debug>: <MFEWSBackgroundBodyFetchTask: 0x7ffd3065e560> Fetched bodies for 0 messages, missed 0 messages. 0 mandatory bodies remaining, 1 discretionary bodies remaining, 0 fetched bodies to persist
    • With the Exchange account online, I could watch the EWSBodyFetch.log file grow in the finder by the second at a remarkable rate. While it was doing this, in Mail, a message below the list of mailboxes in the 3 panel view would read "Downloading Messages; 104 of 104" above which was a progress bar that never quite reached its end
    • Manually cleaning up my Exchange inbox didn't find any rogue messages (I don't know if the above Console message or any of the other messages in the Console log would have provided clues).

    A person whose advice I trust on a Mac email listserv suggested deleting and recreating my Exchange account in Mail. I didn't plunge directly ahead with that, but I did create a new Mac user on my El Capitan-running laptop and recreated my Exchange Account in that user space. That succeeded, (meaning that all my folders appeared in the new user's iteration of my Exchange Account, and that in the new user's space, the Exchange account was a good citizen (no continuous downloading of one single message, no mushrooming log files, etc.).

     

    Now emboldened, I deleted the Exchange account in my standard Mac user space and recreated it, and it appears my problems are solved!

  • by Chuck Stewart,

    Chuck Stewart Chuck Stewart Oct 15, 2015 2:23 PM in response to miguel.apple
    Level 1 (0 points)
    Oct 15, 2015 2:23 PM in response to miguel.apple

    Thanks Miguel.

     

    I searched

     

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


    I didn't find any *.log but rather found the file with tens of gigabits in size. In my case, it was


    2015-1-13_IMAPSyncActivity.log


    I pull it out onto the desktop and relaunched Mail. It worked. No more memory leak.

  • by Chakdag,

    Chakdag Chakdag Oct 15, 2015 8:11 PM in response to JimRobertson
    Level 1 (10 points)
    Oct 15, 2015 8:11 PM in response to JimRobertson

    Hi there,

     

    Here is what I have learned in that tedious process of fixing Mail :

    - if your Mail is leaking RAM then deleting Containers/com.apple.mail and your oversized *.log file will help you take back control of your computer. Ref. Luigino and Miguel's solutions combined.

    - BUT THIS WILL NOT FIX IT

    - the log file will keep growing rapidly as stated by JimRobertson and eventually you'll end up with the same problem again.

    - likewise, as Jim said, you'll notice that the activity bar of Mail is stuck downloading / fetching messages.

    - given Jim's explanation and what I have noticed, this can happen as much as with IMAP as with Exchange configuration apparently (my case was IMAP) and the mutant file was yyyy-mm-dd_IMAPSyncActivity.log

    - you might not notice this behavior immediately if you don't keep Mail open all the time as these *.log files are daily files and every day it'll zip the old one and recreate a new one with a new date.

    - to see if you have a mutant .log file you need to monitor it with Console as suggested by Jim and you will see the entries that'll keep coming and the size of the file increasing crazily fast.

    - at this stage you'll need to identify which account is generating these repeated entries in your *.log file. In my case it was the only IMAP account from an external provider (not iCloud nor Gmail).

    - Like Jim, deleting and reinstalling this erratic account is the only thing that had fixed it and everything went back to normal.

    - Don't forget to delete your old oversized *.log file prior to this so you start clean.

    - After this keep monitoring the .*log file through Console to check it's behavior.

     

    Good luck !

     

    Chak

  • by HaggisArts,

    HaggisArts HaggisArts Oct 19, 2015 2:26 PM in response to miguel.apple
    Level 1 (0 points)
    Oct 19, 2015 2:26 PM in response to miguel.apple

    miguel.apple THANK YOUUUUU!!! I was ready to throw my iMac out of my 3rd floor window. Quick question. Will I have to do this often, or will this one-time deletion of these huge log files take care of the issue for good? Thank you again.

  • by JimRobertson,

    JimRobertson JimRobertson Oct 19, 2015 2:41 PM in response to HaggisArts
    Level 1 (1 points)
    Oct 19, 2015 2:41 PM in response to HaggisArts

    HaggisArts wrote:

     

    miguel.apple THANK YOUUUUU!!! I was ready to throw my iMac out of my 3rd floor window. Quick question. Will I have to do this often, or will this one-time deletion of these huge log files take care of the issue for good? Thank you again.

    The messages at the end of the conversation, from me and from Chakdag hopefully will address this for you. The log files grow because there's a problem with something that they're recording. It appears that "something" may be the transmission of a somehow damaged message from an IMAP or Exchange server. You can watch those log files grow by the second if you open "Console", the program that records what your Mac is doing behind the "GUI" (graphics user interface). Another clue can come from the Message Viewer main window in Mail itself, which my constantly display attempts to download the same message over and over. If either of these is true, deleting the IMAP or Exchange accounts in question from your Mac, then re-creating them may solve your problem, as it has for us.

     

    What I don't understand is why ONE instance of an account may be so afflicted, but a new instance of that email account in the same user space won't be. Typically, the problem has been discovered after an OS X upgrade, so there must be some interaction between the upgrade process and the contents of the mail account, but I have no idea what it is. In my case, it was an Exchange Account. In some other peoples' cases, it's been an IMAP account.

     

    Please note that while it's safe to delete and recreate a properly (or improperly) functioning IMAP account, that's NOT the case for POP accounts, and if you don't know why, you shouldn't be messing with this stuff in the first place!

     

    Jim Robertson

  • by Chakdag,

    Chakdag Chakdag Oct 21, 2015 7:11 PM in response to JimRobertson
    Level 1 (10 points)
    Oct 21, 2015 7:11 PM in response to JimRobertson

    Guys,

     

    Newest update of El Capitan includes 2 fixes for Mail and might sort our current issues says Apple Support.

     

    About the OS X El Capitan v10.11.1 Update - Apple Support

    • Fixes an issue where outgoing server information may be missing from Mail.
    • Resolves an issue that prevented display of messages and mailboxes in Mail.

     

    I'm doing it and will report here.

Previous Page 2 of 6 last Next