akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
949 stars 512 forks source link

Memory size of 1073741824 exhausted; Excel Connector #4261

Closed mohamedSolimani closed 8 years ago

mohamedSolimani commented 8 years ago

We're trying to install the Excel Connector (v.1.5.*) in our Akeneo system (v 1.4.14) but we have a php problem as regards to the memory limit. Where wan we change this limit?

sudo php composer.phar require --prefer-dist akeneo-labs/excel-connector-bundle:1.5.*

Running composer as root is highly discouraged as packages, plugins and scripts cannot always be trusted ./composer.json has been updated Loading composer repositories with package information Reading composer.json of akeneo/pim-community-dev (TIP-342-remove-useless-connecReading composer.json of akeneo/pim-community-dev (behat-refactor-datagrid) Updating dependencies (including require-dev)
PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 72 bytes) in phar:///var/www/html/pim-local/composer.phar/src/Composer/DependencyResolver/RuleSetGenerator.php on line 126

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 72 bytes) in phar:///var/www/html/pim-local/composer.phar/src/Composer/DependencyResolver/RuleSetGenerator.php on line 126

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

jmleroux commented 8 years ago

Yes composer update need a large amount of memory. It's not a PIM bug. You can try php -d memory_limit=2G composer update

mohamedSolimani commented 8 years ago

Thank you for your reply. I have tried this, but there is still an error :

sudo php -d memory_limit=2G composer.phar update Running composer as root is highly discouraged as packages, plugins and scripts cannot always be trusted Loading composer repositories with package information Updating dependencies (including require-dev)

PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php:954 Stack trace:

0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///var/www...', 954, Array)

1 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(954): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)

2 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(754): Symfony\Component\Console\Application->getSttyColumns()

3 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(715): Symfony\Component\Console\Application->getTerminalDimensions()

4 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(648): Symfony\Component\Console\Application->getTerminalWidth()

5 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(1 in phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php on line 954

Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php:954 Stack trace:

0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///var/www...', 954, Array)

1 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(954): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)

2 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(754): Symfony\Component\Console\Application->getSttyColumns()

3 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(715): Symfony\Component\Console\Application->getTerminalDimensions()

4 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(648): Symfony\Component\Console\Application->getTerminalWidth()

5 phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php(1 in phar:///var/www/html/pim-local/composer.phar/vendor/symfony/console/Application.php on line 954

jmleroux commented 8 years ago

Hi @mohamedSolimani , it seems your platform is short in memory :( The message is quite explicit :

The following exception is caused by a lack of memory and not having swap configured

Note that it is a composer message : you may have swap on your system. Anyway, you're running short on memory. What are your system specs ?

Edit: you should have less than 2G RAM, because this error shows you allocate more memory than available to your php process.

juliensnz commented 8 years ago

Hello,

Another advice: don't run composer in root, it's a bad practice :)

Regards,

Julien