Got a php error, Allowed memory size of 536870912 bytes exhausted. It is quite strange, because I created a php info file to check the settings.

The setting of the server is memory_limit 12288M (server got enough free RAM).

What am I missing? Is there a other setting that is set to the 512MB?


PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 53248 bytes) in /lib/Varien/Image/Adapter/Gd2.php on line 74
  • Have you also checked .htaccess php_value memory_limit?
    – sv3n
    Jul 1, 2017 at 21:42
  • @sv3n Yes, the main (root) .htaccess file contains the line php_value memory_limit 12288M so that can also not be the problem..
    – JGeer
    Jul 1, 2017 at 21:43
  • What code execution is happening when you get this error? It has only happened to me when i have set up something like a collection in a loop or the like.
    – circlesix
    Jul 2, 2017 at 14:46
  • First it is not memory issue. Some of your collection loading or looping or collecting data take more time. first check log which collection take time. Jul 2, 2017 at 17:42
  • @RamaChandran Thanks for your reply. What log exactly do I need to check? Where will this be logged?
    – JGeer
    Jul 2, 2017 at 18:16

1 Answer 1



You can put also in index.php/cron.php ini_set('memory_limit', '768M'); or more.

  • Thanks! But it is for Magento 1.9.3 so php bin/magento deploy:mode:set production does not work.
    – JGeer
    Jul 2, 2017 at 11:00
  • I've updated my answer. You can do the same with index.php and cron.php. Jul 2, 2017 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.