Opened 10 years ago

Closed 6 years ago

#2490 closed Bug/Something is broken (fixed)

drush running up against PHP memory limits

Reported by: Jack Aponte Owned by: Jamie McClelland
Priority: Medium Component: Tech
Keywords: drush php-limits Cc:
Sensitive: no


Hey all - since starting to use the MFPL drush installation, I've been getting lots of errors like this one:

255 ninetofive@albizu:~/$ drush status

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 122880 bytes) in /home/members/ninetofive/sites/ on line 890
Drush command could not be completed.                                [error]

That's happened on julia, viewsic, albizu, and probably some other servers. On albizu the memory_limit in /etc/php5/cli/php.ini is set to 16M, and I'm assuming that's the case on the other servers, too. Any way that can be upped?

Change History (6)

comment:1 Changed 10 years ago by Jamie McClelland

It looks like we have a real smattering of different sizes between our machines.

The default for etch was 16M (hence Albizu). The default for lenny is 32M (which is what julia is set to).

I've tried to go through and make sure they are all at least 64M. Let me know if you run out of memory on any of the servers now.


comment:2 Changed 10 years ago by Jack Aponte

Great, thanks Jamie! Haven't had any problems since, but will let you know if any come up.

comment:3 Changed 9 years ago by Jack Aponte

Hi again, Jamie -

Looks like 64M might not be enough. I've been encountering these memory errors again on julia and albizu; probably on other servers, too, just can't remember which ones!

comment:4 Changed 9 years ago by Jamie McClelland

Hi Jack,

This problem was really bugging me - it seems wrong to changething system wide that should be configurable by each user. I just did some web searching and found a few interesting new pieces of information.

First - you can you can dynamically up the memory limit of a php cli script via the command line with:

php -d memory_limit=128M path/to/script.php

Not helpful with drush, but at least it shows what's possible.

Then, I found the answer I was really looking for. I think what you want is to create a drushrc.php file in the sites/default directory of the drupal site you are working with and put in that file:


Let us know if that works.


p.s. you could also put it in your home directory, but I think this setting is more useful as a per-drupal site file, one that could be included the project's revision control system.

comment:5 Changed 9 years ago by Jack Aponte

Thanks for this, Jamie! I've tested it with just one site so far (palantetech on albizu) and it seems to be working so far. I'll let you know if I encounter any cases where it doesn't work.

I'm still experiencing some other drush issues that I've been meaning to mention, but I'll save that for another ticket. :)

  • Jack

comment:6 Changed 6 years ago by Ross

Keywords: drush php-limits added
Resolution: fixed
Status: newclosed

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.