Magento 1.9 Error – Fixing Allowed Memory Size Exhausted Issue

errormagento-1.9memory

I'm new to Magento and I can see that it is a sophisticated system with a lot of depth, but I've come across many headaches since switching to it from OpenCart. The first and foremost is this error that I get when trying to add a product:

"Fatal error: Allowed memory size of 41943040 bytes exhausted (tried
to allocate 139564 bytes) in
/home/vainlane/public_html/mag/app/code/core/Mage/Core/Block/Abstract.php
on line 944"

In the htaccess there are these lines:

php_value memory_limit 512M
php_value max_execution_time 38000

I modified the original 256 to 512, but no difference. Can anybody point me in the right direction here? Pretty stumped. I'm using this installation on a cPanel configuration on reseller hosting.

Best Answer

Hard Coded 32M memory_limit.

If you are running this off a shared server, your memory_limit may be locked down to 32M so you're forced to fairly share resources with others on the server. Magento doesn't run well on shared servers that have not been optimized for Magento, btw.

Your web server may not be set up to use memory_limit out of .htaccess and thus requires you to use a php.ini file to set memory. See the php.ini.sample file that Magento installs in its root folder for what the php.ini file contents need to be.

Otherwise, check with your hosting service provider and ask them to bump the limit to 512M.