composer: Fatal error: Allowed memory size of 1073741824 bytes exhausted

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 72 bytes) in phar:///usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar/src/Composer/DependencyResolver/RuleSetGenerator.php on line 126

This problems happens lots of times since I use Composer .even though the composer diagnose gives a good result,

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking composer version: OK

I have set php memory unlimited, this error still goes, any one has a solution for this?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 25 (5 by maintainers)

Most upvoted comments

Have you tried using the PHP’s command line parameter (instead of the INI value) for setting the memory limit?

Like this: php -d memory_limit=-1 composer.phar install

It’s a known issue. Composer sets the memory limit to 1G. https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors

export COMPOSER_MEMORY_LIMIT=-1

This will solve the problem

try this: php -d memory_limit=-1 composer.phar update symfony/symfony --with-dependencies

export COMPOSER_MEMORY_LIMIT=-1

This will solve the problem

This is worked for me well

Vous avez ce genre de problème avec la command: " composer update "

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108864 bytes) in phar://C:/wamp/www/symfcom/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

Faites la commande: " php -r “echo ini_get(‘memory_limit’).PHP_EOL;” "
pour voir la valeur actuelle de " memory_limit " généralement elle est: 128M

Ensuite allez dans le disque où vous avez installer wampserver exemple :\wamp\bin\php\php7.2.14

dans le fichier wampserver entrez dans le dossier \bin\php que vous utilisez, dans le dossier en question cherchez le fichiez php.ini, dans le fichier php.ini cherchez la ligne " Memory_limit " changer la valeur 128M à -1

Enfin retournez dans votre Cmd et refaites la commande : " composer update " et chekebouuum la solution 👍 👍

memory_limit =-1 in php.ini this solve my issue.

Solution is in php.ini set memory_limit =-1

@skillberto do you really want to test against dev versions of every package? Installing your bundle takes 1.4GiB of memory to do the dependency resolution, if you change the minimum stability to stable it only takes 400MiB and is a good 100 seconds faster.

WHAT FOR WINDOWS?

Try to run: composer install first, sometimes the app contains some errors that creates a infinite loop, and that cause the memory problem. If you found any error, solve it, and try to run: composer update.

Allowed memory size of 1610612736 bytes exhausted (tried to allocate 32 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220 whaat should I do i can’t install any bundle