I have Drush installed on my Inmotion hosting server.
For one Drupal 7 site, it works just fine but for the other one, which is nearly identical, it doesn't work so well. Some commands it allows (like my favourite drush sql-dump or drush cc followed by 5) and but when I do a command drush cc all it throws an out-of-memory issue as shown below:

Drush command terminated abnormally due to an unrecoverable error.                                                                         [error]
Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in
/home/myAccount/public_html/mysite.net/sites/all/modules/views/includes/base.inc, line 129

The issues stemming from the base.inc file are:

after command: drush cc all: on line 129:
$storage[$option] = isset($definition['default']) ? $definition['default'] : NULL;

The issues stemming from the view.inc file are:

after command: drush cc all: on line 2244:
$this->$field = unserialize($info['serialized default']);

after command: drush cc all: on line 2312:
$this->$field = empty($info['serialize']) ? $data->$field : unserialize($data->$field);

The php.ini files are identical on both sites. The settings.php files are not identical and I thought it would be resolved by adding the same lines to the ending of the file

ini_set('memory_limit', '512M');
$conf['error_level'] = 2;
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

but this didn't solve the problem (even after clearing the cache).

What could cause this problem?

  • 1
    Try to increase your memory_limit to 1G or -1 if you don't want a memory_limit – MacSim Nov 19 '20 at 0:56
  • Thank you so much! I've changed it to 1G and it didn't throw any errors anymore. I read somewhere that the option -1 as memory_limit is not advisable, is that correct? – BassPlaya Nov 19 '20 at 1:10
  • 1
    Interesting: if the ini_set('memory_limit', '512M'); is not set in the setting.php file, it will still throw an error. If it is set, the error is gone. – BassPlaya Nov 19 '20 at 1:26
  • I don't have the knowledge to answer your question about the -1 value. All I can say is I never had problems with it on a dev machine. But is it advisable for a production server ? I don't know, I am sorry. – MacSim Nov 19 '20 at 2:18
  • I appreciate your help and honesty, MacSim – BassPlaya Nov 19 '20 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.