Ever faced an error that says:
Allowed memory size of 1610612736 bytes exhausted (tried to allocate 134217736 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 83
You might have faced this error while running the static content deploy or compilation command. Moreover, while installing a library using a composer, the memory exhausted error occurs.
This is due to the limited memory of your localhost or live site. The library you are installing may require more memory limit for successful installation which is not available and hence the error occurs.
The solution for this error is to directly increase the memory limit using the command given in this post.
Solution for Allowed Memory Size of Bytes Exhausted in Magento 2:
Add memory limit in the command:
php -d memory_limit=-1 bin/magento setup:di:compile
php -d memory_limit=-1 bin/magento setup:static-content:deploy
Add memory limit while installing library using composer:
For this, first you’ll need to find the path of the composer the below command:
$ which composer
It will return the path of the composer which is used as shown below:
php-d memory_limit=-1 [composer_path] require twilio/sdk
Any doubts about the memory limit error for Magento 2 console command?
If so, do mention it in the Comments section below. I’d be happy to help.
Also, do share the solution with Magento Community via social media.
Get Weekly Updates
Never miss Magento tips, tricks, tutorials, and news.
Thank you for subscribing.
Something went wrong.