Skip to main content
101 votes
Accepted

Magento 2 Allowed Memory exhausted error when compile code

A quick solution for memory limit in Magento 2 command is directly adding memory limit inside command. For Compilation command, php -dmemory_limit=5G bin/magento setup:di:compile For Deployment ...
Rakesh Jesadiya's user avatar
15 votes

Magento 2 Allowed Memory exhausted error when compile code

use this 'dirty' way php -dmemory_limit=-1 bin/magento setup:di:compile
Ansyori's user avatar
  • 841
10 votes
Accepted

Magento 2.x PHP memory_limit requirements

As the documentation snippet you found explains, 2G is the memory limit to cover all possible use cases. Some operations (particularly command-line operations like setup, testing, and compilation) can ...
Ryan Hoerr's user avatar
  • 12.3k
9 votes

Memory limit when uploading product image

There is a known bug in the GD library of Magento CE 1.x where it can't handle memory limits other than in KB or MB. To solve the issue and assign higher memory limits (GB), you will need to make the ...
Michael Yaeger's user avatar
7 votes

Magento 2 Allowed Memory exhausted error when compile code

php -dmemory_limit=6G bin/magento setup:di:compile
Sheshgiri Anvekar's user avatar
7 votes

Magento2 : How To Solve Out Of Memory Limit Error While Using Composer Update Command

Try full path to composer whereis composer Once you know path php -d memory_limit=4G /opt/cpanel/composer/bin/composer update -vvv
Dominic Pixie's user avatar
5 votes

Magento 2 Allowed Memory exhausted error when compile code

If you are using PHP >= 5.3.0 and you used the Magento 2.1.x and above, then after you run composer install, two files will be created in your root directory and your pub directory named .user.ini ...
Toan Nguyen's user avatar
  • 3,059
4 votes
Accepted

Avoiding memory exhaustion when updating product stock?

Avoid saving entire objects One of the biggest problem in your case is that you save the entire stock item every time. It's not performance friendly. For some models, Magento provides a ...
Raphael at Digital Pianism's user avatar
4 votes
Accepted

Magento 2 run setup:di:compile command on a shared hosting with limited memory_limit (max 512M)

Increase the memory limit to update .php.ini file If you have access to your php.ini file or can create one in the root, you can globally increase your allocated memory. ;adjust memory limit ...
Shorabh's user avatar
  • 1,508
3 votes
Accepted

How can i solve Larger file import error in wamp - Out of memory

Try these different settings in C:\wamp\bin\apache\apache2.2.8\bin\php.ini Find: post_max_size = 8M upload_max_filesize = 2M max_execution_time = 30 max_input_time = 60 memory_limit = 8M Change to: ...
Ashar Riaz's user avatar
  • 1,035
3 votes
Accepted

Debug Mage_Index_Model_Event stock related memory problem during checkout

Honestly, it's hard to guess which line consumes the most memory. I suggest you use the profile to find out exactly which line is the culprit. First enable the profiler. Then update the code with ...
Raphael at Digital Pianism's user avatar
3 votes
Accepted

Issue with memory setting up Magento 2.0

Your error indicates the memory limit is 32 MB (very low). Given the ways you've already tried to override it (including through cPanel), I would recommend contacting your host about the problem. You ...
Ryan Hoerr's user avatar
  • 12.3k
3 votes

Magento 2 Allowed Memory exhausted error when compile code

This situation can be tricky to debug since if you just to php -r "echo ini_get('memory_limit').PHP_EOL;" it shows the memory limit for the PHP in your path, which might be fine. But the magento ...
Scott C Wilson's user avatar
3 votes

How to run deploy command while memory exhausted and we can't able to increase server memory limit?

Before posting a question on Stack Exchange, please have a little look around first, you'll often find the question has already been asked/answered. Maybe just asked in a slightly different way. See ...
JoshCarter's user avatar
3 votes

setup-cron.ERROR: real memory limit 756M but 512M in log

I'd like to add my input here because it's too lengthy to put in a comment and I've been struggling with this issue for quite a while not being able to find a simple way to fix it. In shared hosting ...
gabtzi's user avatar
  • 666
2 votes

Magento 2 Allowed Memory exhausted error when compile code

I run into similar problem, memory limit was increased to 2Gb inside php ini file, phpinfo() file showed it was set to 2Gb. It seems Magento set memory limit manually somewhere. I increased memory ...
JohnyFree's user avatar
  • 1,539
2 votes

Fatal error memory exhausted Zend Pdo

When I made sure the cronjob was able to run -> the error disappears. Greets
TonkBerlin's user avatar
2 votes
Accepted

Fatal error: Allowed memory size on php 5.6.3

Magento comes with a default .htaccess file in the root directory that includes this configuration directive. php_value memory_limit 256M php_value max_execution_time 18000 OR The php memory ...
Abdul's user avatar
  • 9,701
2 votes

Magento 2 Allowed Memory exhausted error when compile code

I have got solution for my question. For memory exhausted error, we have to add memory limit for compile code. php -dmemory_limit=4G bin/magento setup:di:compile Hope it will help someone in future.
Khushbu Mehta's user avatar
2 votes
Accepted

What is the optimal setting for PHP's memory_limit for Magento 2

You need min of 500M to run Magento properly but 1 G would be ideal. With 64M it won't even work.
oCodewire's user avatar
2 votes

Avoiding memory exhaustion when updating product stock?

When I have been doing things like this the best use of memory management that I found was to clear the variables that are no longer in use. You are creating an instance of a product but not assigning ...
John Cuthbert's user avatar
2 votes
Accepted

PHP errors on Magento Server

1. Try to change my.cnf max_allowed_packet = 16M wait_timeout = 1800 connect_timeout = 120 And you will need to restart your MySQL server 2. Memory limit for PHP can be configured in following ...
Vadym Kalin's user avatar
  • 1,257
2 votes

How to run deploy command while memory exhausted and we can't able to increase server memory limit?

Please try below command php bin/magento c:c php bin/magento setup:upgrade php -d memory_limit=5G bin/magento setup:static-content:deploy php -d memory_limit=5G bin/magento setup:di:compile ...
Sarvesh Patel's user avatar
2 votes
Accepted

How to prevent memory consumption during collection enumeration?

You need to change how you iterate the collection. Inchoo did a great write-up on the issue: https://inchoo.net/magento/working-with-large-magento-collections/
ProxiBlue's user avatar
  • 9,926
2 votes

Memory issues when upgrading from 2.2.6 to 2.3

magento 2.3 requirement of 2 gb ram
Rakesh Donga's user avatar
  • 5,364
2 votes

Magento 2 Customer Grid index is locked by another reindex process. Skipping

Please try Get indexes info php bin/magento indexer:info Check the indexes status php bin/magento indexer:status Reset all indexes and reindex again php bin/magento indexer:reset php bin/magento ...
Nikolas's user avatar
  • 2,291
2 votes

Magento2 : How To Solve Out Of Memory Limit Error While Using Composer Update Command

You can try below command COMPOSER_MEMORY_LIMIT=-1 composer update Hope this will help you!!
Jafar Pinjar's user avatar
  • 1,949
1 vote
Accepted

Error Memory Size in Yireo Email Tester

Thanks so much for your help on this. I was able to figure this out by simply editing my php.ini on local/shared hosting environment. works great now!
gx2g's user avatar
  • 273
1 vote

Error Memory Size in Yireo Email Tester

Try adding this line to your .htaccess (for testing): php_value memory_limit 1024M This 1024M value assumes you have 1gb of memory available. You can adjust the amount accordingly for more or less ...
Steven J's user avatar
  • 808
1 vote

Error Memory Size in Yireo Email Tester

Sure! It seems some database query of Yireo module needs more than 512Mb php memory_limit You'd increase that php parameter, or maybe (better) debug that concrete query, so you can optimize it
Raul Sanchez's user avatar
  • 3,125

Only top scored, non community-wiki answers of a minimum length are eligible