lando / lamp

The Official LAMP Lando Plugin
https://docs.lando.dev/lamp/
GNU General Public License v3.0
2 stars 8 forks source link

PHP Fatal Error: Out of memory - Apple M1 Chip #3

Closed arnoldski closed 2 years ago

arnoldski commented 3 years ago

Tell us about your setup

Tell us about your .lando.yml I'm using a Drupal 7 recipe.

# Project name
name: website-x

# Start with a default recipe
recipe: drupal7

# Configure the recipe
config:
  php: '7.4'
  via: apache:2.4
  webroot: web
  database: mysql:5.7
  drush: ^8
  xdebug: false
  composer_version: 2

proxy:
  appserver:
    - website-x.lndo.site
  mailhog:
    - mail.website-x.lndo.site
  pma:
    - pma.website-x.lndo.site

Tell us about the error you got I'm experiencing the same issue as described here: Fatal Error: Out of memory on new M1 Chip.

appserver_1  | mmap() failed: [12] Cannot allocate memory
appserver_1  |
appserver_1  | mmap() failed: [12] Cannot allocate memory
appserver_1  | [Fri Aug 06 08:40:36.090230 2021] [php7:error] [pid 5037] [client 172.20.0.2:54184] PHP Fatal error:  Out of memory (allocated 8482816) (tried to allocate 4282056 bytes) in /app/web/includes/common.inc on line 1010

Tell us more I've already increased the memory of Docker and set the memory_limit = -1 in php, but that doesn't help.

The application/setup worked fine on my old Intel mac. Does anybody has an idea or (temp) solution?

Thanks!

arnoldski commented 3 years ago

I was able to create a temporary fix by using another Docker image. This is my adjusted .lamdo.yml file

name: website-x

recipe: drupal7
config:
  php: '7.4'
  via: apache
  webroot: web
  composer_version: 2
services:
  appserver:
    overrides:
        image: drupal:php7.4-apache  
pirog commented 3 years ago

@arnoldski have you increased the available memory in the Docker Desktop UI? I know a lot of users have bumped that up to 4GB.

arnoldski commented 3 years ago

@arnoldski have you increased the available memory in the Docker Desktop UI? I know a lot of users have bumped that up to 4GB.

Yes I did, I've put it even at 8GB, without any result.

pirog commented 3 years ago

If you have 8GB allocated my next best guess would be you have a memory leak in your application. most of our users use 2GB or 4GB and do not have issues.

arnoldski commented 3 years ago

If you have 8GB allocated my next best guess would be you have a memory leak in your application. most of our users use 2GB or 4GB and do not have issues.

I don't think so, the same application is running fine on 2 other Intel macs where I just allocated 4GB for Docker. And with the other image drupal:php7.4-apache it's also working again with 4GB Docker memory.