Apple Mail crashing constantly with Low Memory (RAM) pop-up

When using Apple Mail on my Macbook (running Mojave with 16 Gb of RAM) my mail keeps crashing followed by a pop-up saying I'm out of memory. When I check the Activity Monitor when Mail is open, the app is using at least 10 Gb of RAM which seems unusual.

I keep a lot of emails in folders within Mail and wonder if there's too much going on.

Also, my junk folder shows 47 items but there's nothing there. I checked the Mail folder (finder>home>mail>... and there's a junk folder labelled junk.mbox.


Any thoughts would be appreciated.

MacBook Pro 15″, macOS 10.14

Posted on Dec 22, 2021 12:03 PM

Reply

Similar questions

4 replies

Dec 22, 2021 2:36 PM in response to AppleMail_232

65GB may be too low if you run apps that want lots of memory, such as video editing, large format photo editing, virtual machines, etc...


If you you just use light duty apps, then 65GB may be sufficient.


Go through my previous reply and figure out if your problem is from apps using too much memory, or your system is running out of free space.


NOTE: You have to do your checks WHEN you hare seeing the dialog box. Just looking now, when you are not having a problem is unlikely to tell you anything.


So book mark this page, and come back after the next time you experience the "Your system has run out of applications memory" error.

Dec 22, 2021 2:33 PM in response to AppleMail_232

If you are getting "Your system has run out of application memory" dialog boxes, and a list of most likely innocent apps listed, then here is the explanation.


For the record, there are 2 reasons for the "Your system has run out of application memory" dialog box.


A) Your boot disk has very low free storage, and macOS cannot create page/swap files to offload virtual memory contents to disk. This is generally not the case, but I mention because if you do have very low free storage, it might apply.


B) A process (or set of processes) have asked macOS for excessive amounts of virtual memory address space. Virtual memory address space requires macOS to create Virtual Memory Page Tables in the kernel address space to keep track of the application virtual addresses given out. Generally, if there is a memory leak (process asks for a virtual address range, uses the addresses, forgets to give them back, asks for another virtual address range, uses the addresses, wash, rinse, repeat), eventually there are so many virtual memory page table entries trying to keep track of the virtual addresses, that macOS no longer has memory available for applications, and you get the "Your system has run out of application memory".


If you look at Applications -> Utilties -> Activity Monitor -> View (menu) -> All Processes -> Memory (tab), you can see what processes are using lots of memory.


You can also issue the following command from Applications -> Utilities -> Terminal:

ps ax -o vsz,pid,comm | sort -n

which will display the virtual memory used sorted so the largest virtual memory consuming users are at the end. The virtual memory sizes are in 1024 byte units.


NOTE: I have seen situations where no single process is using all the memory, but rather a host of smaller processes are using up all the virtual memory. That is to say, a 100 instances of the same program all running with a moderate amount of memory eventually adds up to a lot of page table entries being used.


I have also seen users with 100's of web browser tabs open, where each tab is being managed by its own separate process. And just because you are not looking at any give tab, does not mean the Javascript running on that web page, is not taking up memory and virtual addresses.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apple Mail crashing constantly with Low Memory (RAM) pop-up

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