Fix Allowed Memory Exhausted Error When Compile Code In Magento 2 :- Sometimes when we execute compile or deploy command it gives allowed memory size exhausted error.
<span class="typ">Fatal</span><span class="pln"> error</span><span class="pun">:</span> <span class="typ">Allowed</span><span class="pln"> memory size of </span><span class="lit">134217728</span><span class="pln"> bytes exhausted </span>
To fix this issue you need to increase memory allocated to php. To increase memory limit you have to set memory_limit parameter to 256M or 512M in php.ini file.
Or for quick solution add memory limit in the command :
php -d memory_limit=1G bin/magento setup:di:compile
php -d memory_limit=1G bin/magento setup:static-content:deploy
Hope so it will help you.
1 comments