You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

Memory leak in recentsd and Mail eating up all my RAM

Since I upgraded to Yosemite, the recentsd and Mail processes have been hogging all my RAM. Everything is fine after restart, but both processes slowly creep up until my computer is practically unusable. I am also getting a lot of these messages in console...


10/29/14 8:27:51.428 PM Mail[363]: Stream 0x60000031c5f0 is sending an event before being opened


I think the two problems mat be related. I have tried repairing permissions, SMC reset, and resetting the PRAM. I even tried


killall -9 recentsd


The problem persists. I read an article that Apple is storing a lot of my recent saves to the cloud here...


http://mjtsai.com/blog/2014/10/26/yosemite-uploads-unsaved-documents-and-recent- addresses-to-icloud/


Maybe something has gone wrong with this. Maybe its the result of my system not being handoff capable. I did unsuccessfully try to do a quite large mail drop the first day I installed Yosemite. Maybe this corrupted something. Either way, I consider this a major bug that I imagine wouldn't have made it to release if Jobs was still in charge. I feel Mac users are getting brushed aside more and more in favor of Apples more profitable projects. The memory leaks in Mail are happening to many other users. Many had GoDaddy IMAP accounts that were causing major issues. I don't have GoDaddy mail, and I am out of ideas. Does anyone have any idea how I can fix this?

MacBook Pro, OS X Yosemite (10.10)

Posted on Oct 29, 2014 6:44 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 24, 2017 5:31 PM

Removing this folder seemed to fix the issue for me, but I'm not sure what this removes. I didn't seem to loose any data with an iCloud Mail account, but your mileage may vary:


~/Library/Containers/com.apple.corerecents.recentsd/Data/Library/Recents

22 replies

Oct 29, 2014 8:24 PM in response to ForTozs

Back up all data before proceeding.

1. Triple-click anywhere in the line below on this page to select it:

~/Library/Mail/Bundles

Right-click or control-click the highlighted line and select

Services Open

from the contextual menu.* A folder may open, or you may get an error message that the item can't be found. Either result is normal. If the folder does open and has contents, move the contents to the Desktop. Relaunch Mail and test. If there's no change, put the contents of the folder back and quit Mail again.

2. Repeat with this line:

/Library/Mail/Bundles

This time you may be prompted for your administrator login password when you remove the items. Make sure they're removed from the folder and not just copied to the Desktop. If necessary, copy them first and then move the originals to the Trash.

*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select

Go Go to Folder...

from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

Oct 31, 2014 6:45 AM in response to ForTozs

This is a bug in either Mail.app or recentsd, and I've reported it to Apple (Radar #18610325). The short version is that Mail.app is constantly asking recentsd for recent contacts (duh) but the sqlite query being used has a hard-coded varying timestamp for recency rather than a parameter:


SELECT recents.ROWID,\n recents.bundle_identifier,\n recents.dates,\n recents.display_name,\n recents.sending_address,\n recents.original_source,\n recents.weight,\n recents.group_kind,\n contacts.ROWID,\n contacts.kind,\n contacts.display_name,\n contacts.address\n FROM recents\n JOIN contacts ON contacts.recent_id = recents.ROWID\n WHERE recents.count = 1\n\n AND (kind IN (?)\n AND (cpsearch(contacts.display_name, ?, 5)\n OR icusearch(contacts.address, ?, 2))) AND bundle_identifier IN (?) AND last_date > 1349878830843


Some combination of these processes (recentsd, Mail.app or both) is creating these sqlite queries and never destroying them (some kind of query cache?), and when you look at the continuing memory allocations, they're all the result of sqlite parsing this query over and over.


Somebody from Apple took note of this issue on Twitter the other day, so I think it's under investigation.

Nov 10, 2014 4:42 PM in response to ForTozs

I have the same issue. I've noticed that the iMap ports on my GoDaddy iMap accounts does get set to 143. After I change them back to 993, I notice the same issue and/or the ports get reset again to 143.


I do notice that once I see Compressed Memory (which I never see), it's all over. I have to reboot the machine to re-stabilize it and I no longer can leave mail open.


What's really frustrating is that while composing email, I see this several times during a long composition.


PLEASE APPLE - FIX THIS!!!

Memory leak in recentsd and Mail eating up all my RAM

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