2

I'm having some issues when running composer install. The problem is my ubuntu machine has only 2GB of RAM but had I never had issues before.

Suddenly the following errors pops up:

ErrorException]
proc_open(): fork failed - Cannot allocate memory

On their website they suggest to enable swap. But swap was already enabled, see below:

                   total   used   free   shared   buffers   cached
Mem:               2000    359    1641   47       11        118
-/+ buffers/cache: 228     1771
Swap:              2047    0      2047

Even after running the following commands, which is their suggestion, the problem is still there. (Also when increased the count) https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1

The memory_limit in my php.ini is set to -1 which is unlimited.

I did a composer install with the --profile flag and this was the output:

Updating dependencies           [3.4MB/2.96s]
Package operations: 58 installs, 0 updates, 0 removals [2246.6MB/33.95s]
Installing brianlmoon/gearmanmanager (2.0.0-alpha)[2246.6MB/34.02s]  Loading from cache[2037.0MB/37.22s] 

As you can see it's consuming all my available memory.

Is there any option to make it using less memory?

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
user3601546
  • 300
  • 1
  • 6
  • 14
  • It might be useful to see your exact dependencies, so we can run it ourselves and figure out there's a problem in your computer or it's just you really have all that data (though 2GB of source code is too much code). – Álvaro González Feb 03 '17 at 11:44
  • Google `composer install allowed memory size exhausted` its a well known issue and a hot topic on the message boards. – RiggsFolly Feb 03 '17 at 11:48

0 Answers0