Drush – Out of Memory

Posted by Mark Milbourne

So this weekend I tried to push some new changes to my staging website.  The site,, is running Drupal so you basically need to run Drush to do any form of updates.  Anyways, I logged onto the server and tried to do a drush update, and I recieved this error:

Fatal error: Out of memory (allocated 22806528) (tried to allocate 30720 bytes) in /home/musici12/ on line 105
Drush command could not be completed.

After digging around the net I found many references to PHP memory limits.  Where most people have fixed this error by simply setting the PHP.ini for Drush to use, or simply added ini_set to the drush.php file.  Here are some links;

None of these worked for me.  I always hit the 22806528 limit no matter what.  This is roughly 20M, which is really small.

The Solution

My problem was the Fork Bomb protection ( that some hosting providers setup.  The basic defense is to restrict your Bash (or whatever) shell to a very limited set of resources so that its difficult to bring down the server.  In my case the memory limits.

After requesting that my hosting provider disable the fork bomb on my VPS, I'm back to being able to update my site.

I hope this helps someone, I wasted a few midnight hours trying to figure this out.

Post to Twitter