I
I
Ivan Ivanov2020-02-26 21:10:07
Composer
Ivan Ivanov, 2020-02-26 21:10:07

Why is composer eating RAM?

I ordered a VPS (512 mb of RAM), I decided to install laravel, it seems to work. I decided to add a package, it displays the error "lack of memory or lack of a paging file." I looked, everything is fine with swapping, I increased the memory_limit in php_ini to 256 mb, the error is the same. Today I reinstalled the system and decided to install laravel, but here is the same error:

The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

PHP Warning:  proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952

Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952
                                                     
  [ErrorException]                                   
  proc_open(): fork failed - Cannot allocate memory

Where does memory go? Before that, there were no problems with hosting, although I don’t think there was more RAM there.
PS: Yes, I googled the problem, everywhere they write about swapping, but everything is ok with it. I also studied the answer from the installer (the link recommended by the installer), but I could not register those commands, there is no access (by the way, I managed to install Lumen (mini Laravel)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2020-02-26
@maksim_fix

Composer's issue with memory consumption when updating with a lot of dependencies is quite well known, just look at their issue tracker ( 1 , 2 and many others).
Jordi Boggiano , one of the Composer authors says (for example here ) that the problem will be fundamentally solved in the second version, which is currently in development.
Aside note: usually, commands that modify the list of packages (and require a lot of memory for this) should only be run during development (i.e., for example, on your local machine), you need to use to deploy the project composer install, and it does not require a lot of memory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question