Solved: Allowed Memory Size of Bytes Exhausted in Magento 2

Solved: Allowed Memory Size of Bytes Exhausted in Magento 2

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:

Here, I’ve set the memory limit as “-1” which means infinite. The required memory will be occupied from the infinite memory available. You can also define an explicit value such as 2G or 5G.

Add memory limit while installing library using composer:

For this, first you’ll need to find the path of the composer the below command:

Solved: Allowed Memory Size of Bytes Exhausted in Magento 2 1

 

 

It will return the path of the composer which is used as shown below:

That’s it.

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.

Thank you.

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

4.9
(based on 12 Reviews)

An expert in his field, Jignesh is the team leader at Meetanshi. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.

Leave a reply:

Your email address will not be published.