brefphp/aws-lambda-layers

Memory issue with bref/php-81-fpm-dev:2

chrisjenkinson opened this issue · 6 comments

Description:

There is a memory issue with the current image bref/php-81-fpm-dev:2 (digest b84118767b2174fc716ec1e1a2cf6bd4db4379e210909199e51735e443aea2ec)

Please see https://github.com/chrisjenkinson/bref-fpm-dev-image-issue/blob/main/.github/workflows/blank.yml which shows a GitHub workflow with the issue, using these images:

  • php:8.1.19
  • bref/php-80-fpm-dev:2
  • bref/php-81-fpm-dev:2
  • bref/php-82-fpm-dev:2

This is the result https://github.com/chrisjenkinson/bref-fpm-dev-image-issue/actions/runs/4965042554/jobs/8885601793

Fatal error: Allowed memory size of 3154116608 bytes exhausted (tried to allocate 2147483656 bytes) in phar:///project/vendor/phpstan/phpstan/phpstan.phar/vendor/nette/di/src/DI/DependencyChecker.php on line 47

PHPStan process crashed because it reached configured PHP memory limit: 3008M
Increase your memory limit in php.ini or run PHPStan with --memory-limit CLI option.

Any reason to believe there is a bug in Bref images?

Judging from what you posted, what we could conclude is that your application is simply eating all the memory, no? Maybe we're missing some context.

The test runs using the standard symfony skeleton and phpstan on level 0. It passes on 3 of the 4 images I mention, other than bref/php-81-fpm-dev:2. It appears there are no other tags for v2 available, though I could try other images which helped triangulate.

oh ok sorry I'm just realizing your link is a custom repo that reproduces the issue. So many discussions to jump between that I overlooked that.

OK so just to clarify: here we have 1 GH Actions run that shows the issue. Is this reproduced every time? Specifically for PHP 8.1? (just want to make sure it's not a random failure, but I guess if you created a repo for that it's not)

I find it very weird that PHP 8.1 has an issue, the Dockerfiles are almost identical with 8.2 🤔 Do you know how much memory is used for 8.0 and 8.2? (or even outside of Docker?)

I have just retriggered it with debug mode and it says 64MB used for 8.2 and 68MB for 8.0.

Yes, I am having the same issue locally (on this custom repo and my project) and on a Gitlab workflow running on AWS.

I ran this again with the new image (from the 2.1.0 release I guess) and had no issues.

https://github.com/chrisjenkinson/bref-fpm-dev-image-issue/actions/runs/5017963235/jobs/8996755836

Awesome! Thank you for updating and following this problem, really appreciate it 🙌