I have been getting problems in El Capitan running out of application memory (and I have 24 GB of RAM and am not running many programs). I checked Activity Monitor and it seems that Apple Mail is the culprit and is eating all of my memory and run time.
I did a google search and came up with this Apple Discussion on the issue. It seems that Mail is loading all of it’s log files into RAM and compressing them into ZIP files. You can at least temporarily fix the problem by deleting your log files at ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/ with Mail closed.
And the problems continue with El Capitan!