lando / pantheon

The Official Lando Pantheon plugin.
https://docs.lando.dev/pantheon
GNU General Public License v3.0
11 stars 18 forks source link

Fatal error: Allowed memory size #31

Closed sdubois closed 2 years ago

sdubois commented 4 years ago

On a Drupal 8 site with Pantheon I am receiving the following error:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /app/core/lib/Drupal/Core/Cache/DatabaseBackend.php on line 167 Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32768 bytes) in /app/core/lib/Drupal/Core/Database/Driver/mysql/Merge.php on line 1 Notice: Undefined offset: 0 in /app/core/lib/Drupal/Core/Utility/Error.php on line 122 Notice: Undefined index: file in /app/core/includes/errors.inc on line 80 Notice: Undefined index: line in /app/core/includes/errors.inc on line 81 Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /app/core/lib/Drupal/Component/DependencyInjection/Container.php on line 166

I have tried rebuilding, restarting, and even upgraded to v3.0.10 but this site always shows this error. When I run lando php -i | grep memory_limit it returns the following:

memory_limit => -1 => -1 which should mean that there is no memory limit.

This is a pretty small Drupal site and other Pantheon sites are running fine. I have Docker configured to use 6GB of memory which feels like more than enough.

dolly-k commented 4 years ago

You can increase the memory_limit in your php.ini file that might solve the problem.

sdubois commented 4 years ago

Since this is using the pantheon script I don't think it is possible to use a custom php.ini file.

dolly-k commented 4 years ago

I had a similar problem and was able to fix it by increasing the memory limit and it worked for me.

On Mon, Jul 27, 2020, 3:38 PM Steven DuBois notifications@github.com wrote:

Since this is using the pantheon script I don't think it is possible to use a custom php.ini file.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lando/lando/issues/2523#issuecomment-664673761, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQSDRFNNSTHHINMOGOI6C3R5X6WLANCNFSM4PJE5ZKA .

dustinleblanc commented 4 years ago

@sdubois It should be possible to override the php.ini using service config (rather than recipe config). See https://docs.lando.dev/config/php.html#configuration (the service name would be appserver).

The Pantheon recipe gives 1GB of memory to the appserver fpm process and unlimited memory for CLI operations. You really shouldn't need to increase the memory past 1GB for the appserver, if you are running out of memory, the application probably has a memory leak.