It appears that Scheduled Jobs for sendmail is throwing memory errors. After it was observed that mail was not sending, I attempted to "Execute Now" from the admin area.

Fatal error: Out of memory (allocated 120848384) (tried to allocate 21703932 bytes) in /home/[site]/www/www/sites/all/modules/civicrm/packages/Mail/mimePart.php on line 313

My host increased my memory, "We just increased your account's memory limit from 195 MB to 295 MB. We applied the changes in your global php.ini settings as well."

Now the error reads:

Fatal error: Out of memory (allocated 203685888) (tried to allocate 29831950 bytes) in /home/[site]/www/www/sites/all/modules/civicrm/packages/Mail/mime.php on line 1030

Any suggestions?

  • 1
    Have you tried changing the 'System Settings" > 'Outbound Email' from Sendmail to mail()?
    – Graham
    Commented Oct 14, 2016 at 7:50
  • I made that change. After clearing the cache in Civi and Drupal, I still get the following: Fatal error: Out of memory (allocated 203948032) (tried to allocate 29831950 bytes) in /home/[site]/www/www/sites/all/modules/civicrm/packages/Mail/mime.php on line 1030 Commented Oct 14, 2016 at 11:33
  • My host increased the memory to 350. Apparently that helped, but then it had a CPU timeout. They increased (temporarily) to 100 seconds for it to finally process. They said that's a temp fix they have to change back. With less than 200 recipients, why would it be using so much memory and timing out after so long? Commented Oct 14, 2016 at 12:29

1 Answer 1


If you are processing more records at the same time - you will run out of memory -

In order to prevent Out of Memory the best way is to process less records in a single go - civimail does process records in a batch (like 200 approx.) at a single go

Whenever we create PDF in bulk, mail in bulk always we use to end up in Out of memory even in local PC or local server - so processing min amount of records should fix the problem

I guess the main problem for this Out of memory Issue is: Civicrm DAO uses more memory and once the process is finished it doesn't free the memory at all. So php memory keeps on building and eventually - so we end up in Out of memory

I guess this helps!!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.