Vladimir2019-01-04 05:40:02
Vladimir, 2019-01-04 05:40:02

After composer update error mmap() failed: [12] Cannot allocate memory, what could be the reason?

PHP version - 7.2
OS - Debian 9
Virtual server physical memory: 1024 Mb
I have a small project with a few dependencies, when I try to do it composer updateI get the following error:

mmap() failed: [12] Cannot allocate memory
PHP Fatal error:  Out of memory (allocated 705966080) (tried to allocate 67108872 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSet.php on line 83

set memory_limit: -1 in php.ini and get a slightly different error text:
mmap() failed: [12] Cannot allocate memory
PHP Fatal error:  Out of memory (allocated 888418304) (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

What could be the reason and in which direction to dig? Is it possible that the server's memory is limited somewhere and how can this be checked?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
DevMan, 2019-01-04

Increase maximum memory for composer?

MinusD, 2020-07-31

This may not be the only thing, I had a similar situation with installing predis through composer, as a result it turned out that not only the composer, but in principle the entire web server was short of memory.
And the solution is elementary, if you use vagrant, for example, just go to VirtualBox and increase the allocated RAM, if it is hosting, you will have to change the tariff.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question