I get a variation on the fatal error message below after running drush en several times with different modules.
I can get around the problem by logging out of my shell and back in again. Seems like a memory leak that accumulates with each iteration of drush en.
The affected modules seem to be enabled despite the error most of the time, but not all.
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 88 bytes) in /home7/enviroc1/public_html/drupal/includes/menu.inc on line 3468
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 88 bytes) in
/home7/enviroc1/public_html/drupal/includes/menu.inc, line 3468
Comments
Comment #1
moshe weitzman commentedThats just Drupal being Drupal. Please increase your memory limit in the php.ini thats in effect for cli requests. The exact location of that php.ini is returned by 'drush status`
Comment #2
ryan_courtnage commentedHi Moshe,
There is definitely something up with version 4.5 of Drush. I've been using a Drush 4.4 script to install my site for months. My script uses "drush site-install" followed by a "drush en" (and the long list of modules my site uses).
With Drush 4.4, I can monitor the php process and see that it peaks at about 50MB of memory usage (the most memory is consumed while running "drush en", and this is understandable).
With Drush 4.5, the php process just starts eating up memory while enabling modules, which ultimately ends in an "Error: Allowed memory size of 134217728 bytes exhausted". That's with a 128MB memory_limit. Even at 256MB I can't install my site.
Reverted back to Drush 4.4 and everything is fine again.
Comment #3
carole commentedI got this on an update of 15 modules with tons of DB updates, and I couldn't tell if rerunning updatedb fixed them all (I got a white screen afterwards). I'm still debugging 10 hours later. Reverting to 4.4.
Comment #4
carole commentedI ran pear install drush/drush-4.4.0. It said it worked, but my drush status says it's 4.5.
1) There's an error in the install
2) Do I have to delete it & reinstall manually? I remember a ton of config issues (perhaps that was on the Windows box), I hope there are none on debian
downloading drush-4.4.0.tgz ...
Starting to download drush-4.4.0.tgz (249,761 bytes)
....................................................done: 249,761 bytes
install ok: channel://pear.drush.org/drush-4.4.0
# drush status
Drush version : 4.5
Comment #5
mollyavalon commentedI'm having the same problem. The php.ini file (that I don't have permission to edit on the university server) specifies 32M.
I bumped up the memory to 256M in ~/.drush/drush.ini, ~/public_html/php.ini, ~/public_html/mysubfolder/.htaccess, and ~/public_html/mysubfolder/sites/default/settings.php.
I get the out of memory error with drush cc.
Comment #6
greg.1.anderson commented@mollyavalon: per #1, run
drush statusto see the exact location of the php.ini file you'll need to edit.Comment #7
mollyavalon commentedSorry not to get back sooner.
drush status tells me it's using /usr/local/lib/php.ini. I'm on shared hosting and can't edit that file.
In ~/drush/drush.ini, I set memory to 256M, which matches ~/public_html/php.ini, which is reflected in my Drupal status report.
I though perhaps ~/.drush/drush.ini was being ignored, but I ran this from my drupal folder (thanks to my colleague Paul), which told me it was finding drush.ini.
strace drush &> ~/drush.trace
drush status runs. I can download with drush.
drush cc gives me this:
drush en omega gives me this:
drush up gives me this:
Any ideas for the next troubleshooting step?
Comment #8
mollyavalon commentedI ran
drush php-eval "phpinfo()" | grep memoryper this issue, and it says memory_limit => 256M => 256M.
Because I was getting out of memory errors, I assumed it wasn't seeing that I have memory set to 256M in drush.ini and in my settings.php file. But it DOES see it.
Is 256M not normally enough?
If it's something else, what could it be? I'm crippled without drush!
Comment #9
ryan_courtnage commented@mollyavalon, please try using Drush 4.4. I suspect it will make your memory problems go away, and will reaffirm that 4.5 introduced the problem.
You can download 4.4 via this link:
http://ftp.drupal.org/files/projects/drush-7.x-4.4.tar.gz
Comment #10
mollyavalon commentedOh, I was so hopeful! I replaced drush 4.5 with 4.4, but I'm still getting the error. Here's what I got from drush cc:
So I went to another drupal installation I have in this same ~/public_html folder, ran drush cc, and it did not fail.
Maybe this is not a drush issue. I'll keep looking.
Comment #11
dwalker51 commentedI backed up my home/drush directory
downloaded 4.4 from http://ftp.drupal.org/files/projects/drush-7.x-4.4.tar.gz
gunzipped and untarred in /home
ran drush status, it came out as 4.4, and since I had previously updated my site i just did a drush up, it showed if I wanted to upgrade to 4.5
A newer version of drush, 7.x-4.5, is available. You are currently running drush version 4.4; to update, run `drush self-update`. To disable this check, put "$options['self-update'] = FALSE;" in your drushrc.php configuration file.Unfortunately I am still getting the error with 128MB of mem in my php.ini
r.n(130) drush en skinr_panels, skinr, skinr_ui
The following extensions will be enabled: skinr, skinr_panels, skinr_ui
Do you really want to continue? (y/n): y
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /uext10/www/noao/includes/menu.inc on line 351
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /uext10/www/noao/includes/menu.inc, line 351
Comment #12
moshe weitzman commentedyour drupal is comsuming all available memory. you need to increase memory_limit in the php.ini. use `drush status` to find its location and make a change in a drush.ini if you can't edit php.ini
Comment #13
mollyavalon commentedI asked our server folks to increase our memory in the php.ini file shown in drush status. It's set at 256M there and also in drush.ini.
Still getting errors like this one resulting from drush cc 1 (all)
Comment #14
greg.1.anderson commentedn.b. 46137344 > 256M
Comment #15
mollyavalon commentedTrue enough. But I am puzzling over why Drupal is functioning fine and drush is not, and this is my only indicator.
Comment #16
dwalker51 commentedChanged /root/.drush/php.ini to 256M from 128M, this was the file that drush was using and not /etc/php.ini, the memory error has gone away, not quite sure why it needs so much though....
drush statusDrupal version : 7.12
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database username : drupal_user
Database name : noao
Database : Connected
Drupal bootstrap : Successful
Drupal user : Anonymous
Default theme : noao
Administration theme : seven
PHP configuration : /root/.drush/php.ini
Drush version : 4.5
Drush configuration :
Drush alias files :
Drupal root : /home/www/noao
Site path : sites/default
File directory path : sites/default/files
Private file directory path : sites/default/files/intranet
Comment #17
ahmedhanyfawzy commentedIf you are on the shared host and you configured correctly the php.ini for higher memory_limit then the solution is very simple you just need to copy the 'correct' php.ini to the installation folder of drush ; and drush will pick it up by default the next time it run , more details here.
Comment #18
Anonymous (not verified) commentedA lot of shared hosts limit php memory usage to 32, 48 or 64Mb.
In such cases, your changes to you php.ini or drush.ini files settings won't allow you to pass that limit.
In my humble opinion, 64Mb is a huge amount of memory and should be more than enough for any site without real memory consuming tasks like image editing.
Unfortunately the world (and especially PHP?) is not ideal, which causes Drupal and Drush to load (in some cases) about any available .php file for a single page, whether needed or not.
This consumes a lot of memory and I can't keep but wondering whether this is really necessary.
I love Drupal and Drush as a system, but keep running into memory limits if I try to add a module to many. That's also may main reason to stick with Drupal-6.x for now.
Comment #20
ambient.impactHi there. My admin recently updated PHP to 5.3.13 and I started to get this exact fatal error without fail. Drush is now unusable. We've tried upping the PHP memory limit to 256M, to no avail. We've tried downgrading 5.4 to 4.4, which made no difference. We're at our wit's end with this. Has anyone got any clues as to how we might work around this? Much appreciated.
Comment #21
juc1 commentedI am having the 'out of memory' problem in Drush 5.4 - is there any news? Is there any command which displays the current memory limit for Drush?
Comment #22
greg.1.anderson commenteddrush ev 'print(ini_get("memory_limit"));'-1 means "no limit".
Comment #23
juc1 commented@ greg - thanks I get
but I am getting
Fatal error: Out of memory (allocated 69730304) (tried to allocate 7680 bytes) in /home/.../sites/all/modules/views/modules/node/views_handler_field_node_link.inc on line 32I am trying to follow the solution suggested above in #17 =
Any clues please on where I can find the 'correct' php.ini?
Thanks
Comment #24
greg.1.anderson commentedFor php.ini: http://bit.ly/NoXZFm
The link quoted in #17 does not appear to be exactly correct. Drush looks for its custom php.ini file, if any in ~/.drush.
Comment #25
juc1 commentedLoaded Configuration File /usr/local/lib/php.ini
Like #7 above this is shared hosting so I can't see this file. # 17 above seems to say copy the php.ini file to another location so can I do this in the command line if I can't see the file? I have also tried copying /drush/examples/example.drush.ini to drush/drush.ini but that doesn't seem to help.
Thanks
Comment #26
greg.1.anderson commentedI can't support crippled hosting plans. You could try to construct a new php.ini from the information from phpinfo(), or use a php.ini from a local machine and hope for the best. Ask for support with your ISP or switch providers. See resources page for providers that support Drush pre-installed.
Comment #27
juc1 commented@ Greg my hosting plan's php.ini memory limit is 256MB so how is it crippled? I thought the problem here was that Drush was for some reason ignoring php.ini and taking a lower limit from somewhere else. Anyway would it help to ask my host for a copy of the php.ini file that I can't see and then copy this file somewhere in my Drush folder?
Thanks
Comment #28
greg.1.anderson commentedIf your hosting provider won't let you read files you need, then you should ask them for support; the Drush issue queue is not the place for this sort of question.
Comment #29
juc1 commented@ Greg I don't follow what you mean by this "If your hosting provider won't let you read files..."
I will try to rephrase: This installation of Drush is on shared hosting - this means that I don't have root access and can't see some files such as php.ini. I expect that my host would send me the relevant php.ini if I asked, but I am first asking here is copying this php.ini file to my Drush folder likely to help with the Drush memory problem?
Thanks
Comment #31
vacho commentedI had the same problem.
A shared server, I copied php.ini with memory_limit = 256M, I copied within Drush and within your site folder, I've also tried to modify the file drush.ini memory_limit.
Until there all told me I was using in memory_limit 256M but still drush with memory problems.
Finally I found this solution:
1. Having php.ini with memory_limit = 256M in the site folder (public_html or www)
2. Modify memory_limit = 256M in drush.ini file within Drush folder (if you have not copy from the examples folder: example.drush.ini)
3. Enable the use of this guideline in the. Htaccess
and with it all right!
I hope they serve
Comment #32
soliyappan commentedI am having this error in my site
Allowed memory size of 134217728 bytes exhausted (tried to allocate 25 bytes) public_html/includes/menu.inc
please any one help me to solve this. Thanks in advance..