I got this error when running composer.phar update on my VM:
PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried t
Composer may sometimes fail on some commands with this message:
PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
Or in my case :
Fatal error: Out of memory (allocated 1116733440) (tried to allocate 134217728 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Pool.php on line 339
In this case, the PHP memory_limit should be increased.
Note: Composer internally increases the memory_limit to 1.5G.
To get the current memory_limit value, run:
php -r "echo ini_get('memory_limit').PHP_EOL;"
Try increasing the limit in your php.ini file (ex. /etc/php5/cli/php.ini for Debian-like systems):
; Use -1 for unlimited or define an explicit value like 2G
memory_limit = -1
Composer also respects a memory limit defined by the COMPOSER_MEMORY_LIMIT environment variable:
COMPOSER_MEMORY_LIMIT=-1 composer.phar <...>
Or, you can increase the limit with a command-line argument:
php -d memory_limit=-1 composer.phar <...>
This issue can also happen on cPanel instances, when the shell fork bomb protection is activated. For more information, see the documentation of the fork bomb feature on the cPanel site.
To get loaded php.ini files location try:
php --ini
Source : (Composer docs)