Fatal error: Out of memory when executing composer require cboden/ratchet on symfony project

1

When installing the package Ratchet, I end up getting an our of memory error.

This apparently becomes an issue when lots of packages are installed, however I only have a few libraries installed on my project (like jquery, bootstrap and jqueryui).

Also I do not understand the previous messages(VirtualFree(): Attempt to access invalid address. and others from this kind).

I am kinda new with composer and with basic knowledge of symfony, so I do not understand what can be the problem.

Here are my errors(this is from first try of installing, the project version is Symfony 3.4.14 (kernel: app, env: dev, debug: true)):

Using version ^0.4.1 for cboden/ratchet
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.


VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.

PHP Fatal error:  Out of memory (allocated 975175680) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Fatal error: Out of memory (allocated 975175680) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
php
symfony
composer-php
ratchet
asked on Stack Overflow Dec 23, 2018 by Ivanp • edited Dec 24, 2018 by Alex

1 Answer

1

This is becoming quite a common issue and isn't necessarily related to the Ratchet package. While it may not be the right solution, the way I have gotten around the problem is by simply removing the PHP memory limit.

You first need to find your php.ini file, its location differs depending on your setup, and then edit the following line:

memory_limit = 128M and change it to memory_limit = -1.

Any issues let me know.

answered on Stack Overflow Dec 24, 2018 by Alex

User contributions licensed under CC BY-SA 3.0