Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer update gives "cannot allocate memory" error. #2160

Closed
ericbae opened this issue Aug 8, 2013 · 2 comments
Closed

Composer update gives "cannot allocate memory" error. #2160

ericbae opened this issue Aug 8, 2013 · 2 comments
Milestone

Comments

@ericbae
Copy link

ericbae commented Aug 8, 2013

My php.ini memory limit is set to "-1" and I'm trying to install a RSS builder (https://github.com/thujohn/rss-l4) using Laravel 4 and I'm getting the following error. Any ideas?

Loading composer repositories with package information
Updating dependencies (including require-dev)

  • Installing thujohn/rss (dev-master df80a7d)
    Downloading: 100%
    PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:975
    Stack trace:
    #0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 975, Array)
    Added ErrorException handler. #1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(975): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
    Edited src/Composer/Downloader/ZipDownloader.php via GitHub #2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(853): Symfony\Component\Console\Application->getSttyColumns()
    Implement PEAR support. #3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(818): Symfony\Component\Console\Application->getTerminalDimensions()
    Edited README.md via GitHub #4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(752): Symfony\Component\Console\Application->getTerminalWidth()
    Edited bin/composer via GitHub #5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 975

Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:975
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 975, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(975): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(853): Symfony\Component\Console\Application->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(818): Symfony\Component\Console\Application->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(752): Symfony\Component\Console\Application->getTerminalWidth()
#5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 975

@jannone
Copy link

jannone commented Aug 29, 2013

+1, composer is using a lot of memory and CPU in my dev box. I had to change my VM config from 512 mb to 1 gb lately, just to run composer.

@curry684
Copy link
Contributor

curry684 commented Mar 3, 2016

Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory

proc_open is not bound by PHP's memory limit configuration - it's a thin wrapper around system level calls to fork the current project. This may turn out rather unfortunate when the host process has tons of memory in use as it could indeed wipe the whole system empty, causing this error.

To my knowledge the improvements last year in the GC handling have made Composer's memory usage friendlier outside the resolver, meaning memory usage is much lower during the installation phase, so this issue has almost certainly resolved itself by now.

@Seldaek Seldaek closed this as completed Mar 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants