I'm getting out of memory errors such as:

Fatal error: Out of memory (allocated 7864320) (tried to allocate 7680 bytes) in /home/<myaccount>/public_html/development/avenue/includes/database/database.inc on line 2487
Drush command terminated abnormally due to an unrecoverable error.       [error]
Error: Out of memory (allocated 7864320) (tried to allocate 7680
bytes) in
/home/<myaccount>/public_html/development/avenue/includes/database/database.inc,
line 2487

when I try to run the command (in Terminal on Mac OS X 10.7.4, with Drush 5.4 and MAMP 2.0.5)

drush @avenue-dev status

@avenue-dev is defined in my aliases file:

$aliases['avenue-dev'] = array( 
  'uri' => 'default',
  'root' => '/home/<myaccount>/public_html/development/avenue', //Path to website root on your production server
  'remote-host' => 'development.<myaccount>.co.uk', // url to your production web server accessible via ssh
  'remote-user' => '<myusername>', // your username on that server. Remember that you should have ssh keys for logging in
  'ssh-options' => '-p 8899',
  'path-aliases' => array(
      '%dump' => '/home/<myaccount>/SQL/avenue-dev-dump.sql', //this keeps you from having to specify dump files
      '%drush' => '/home/<myaccount>/drush',
      '%drush-script' => '/home/<myaccount>/drush/drush',
   ),

);

It would seem that drush is being limited to 8MB, but the fact I can't even run drush status is making it very difficult to debug, as I can't determine which php.ini file it's using. I've worked with my hosting provider (we have a vserver account with them), and they can run the command directly on the server, and have changed all the php.ini files we can think of to 256MB.

I still have my old laptop, and can run the exact same command fine from there (Drush 5.4, Mac OS X 10.6 and MAMP 1.8.4), which again makes me think this is not a problem with the web hosting server, but something local to my new Mac laptop.

I can also run drush fine locally on the new laptop, to all my localhost sites - these memory errors are only occurring when I use site aliases that link to the development and production sites hosted on my vserver.

Any suggestions as to what I might try next to fix this? I'm totally totally lost without drush!!

Comments

moshe weitzman’s picture

Status: Active » Fixed

php --ini shows you the ini files that are in effect for a CLI request

rachelf’s picture

Thanks - I've run that and initially it said

Configuration File (php.ini) Path: /etc
Loaded Configuration File:         (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

So I copied the file php.ini.default usr/etc and edited it so that I've got
memory_limit = 256M

Now I run php --ini and it says

Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /private/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

but I am still getting the same error message for memory?

moshe weitzman’s picture

php -i will show you the .ini values in effect for CLI request.

rachelf’s picture

I'm afraid I'm still not getting anywhere.

php -i shows

Configuration File (php.ini) Path => /etc
Loaded Configuration File => /private/etc/php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)

and further down I can see

memory_limit => 256M => 256M

but I still get the error message.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rachelf’s picture

Title: Error: Out of memory Mac OS X 10.7.4 and MAMP 2.0.5 » Error: Out of memory Mac OS X 10.7.4 and MAMP 2.0.5 - ssh problem

This turned out to be an SSH problem relating to Mac OS X 7 Lion.

The SSH client shipped with Lion seems to be sending incorrect values to the server. The fix is to tell the SSH client not to send any LC_* variable:

  • Open the SSH client configuration file (/etc/ssh_config).
  • Comment out the line that instructs the SSH client to send those variables (SendEnv LANG LC_*) from the general host configuration section (Host *).

You should end up with the following fragment:

Host *
# SendEnv LANG LC_*

Many thanks to ded for helping me out on this. Here's the link to the original post that helped him solve this: http://thegreyblog.blogspot.co.uk/2012/02/fixing-mac-os-x-lions-ssh-utf-...

rachelf’s picture

Issue summary: View changes

Replaced my server details with and