I have the error PHP Fatal error:

Allowed memory size of 805306368 bytes exhausted

It is when I use one filter in catalog on Magento 2.

I changed php.ini memory_limit = 1G, but it is not working.

This is phpinfo:

enter image description here

and this catalog:

enter image description here

and the error is when I click in anywhere filter.

The code is in the core of Magento, It is supposed to work if it does not change.

Only I changed the site of filters

What I can do?


  • Typically, if you have out of memory and have memory limit at lest at recommended level, (for M2 512M), increasing the limit won't help. You have a bug in the code. It is best to check php logs to understand where in the code the problem occurs and trace stack backwards to see where the actual problem is. – Tero Lahtinen Jan 18 '18 at 13:03

805306368 bytes is 768MB, so your 1G limit is not being set. Try 1024M instead, ideally more as 1GB isn't really enough to run Magento reliably.

  • It is changed, but it not working – AndresF Dec 20 '16 at 16:58
  • In your screenshot it's set to 768M locally, so check there isn't any other memory_limit = in your php.ini – Eamonn Dec 20 '16 at 16:59
  • Only has one memory_limit in php.ini – AndresF Dec 21 '16 at 7:49
  • 1
    Is this on shared hosting? Your provider might be limiting it in that case. – Eamonn Dec 21 '16 at 9:05

You can check your memory limit by creating a phpinfo.php in the pub folder file.



// Show all information, defaults to INFO_ALL

Source: http://php.net/manual/en/function.phpinfo.php.

Check your current memory limit by opening www.yoursite.com/phpinfo.php. Increase the memory limit if this is necessary.


Increasing your memory limit is a temporary solution. You probably have some code going berserk somewhere. Try to find out why this one filter is causing such heavy load. Could you share with us how you're filtering your catalog?

  • It is in the core in magento, It is supposed to work if it does not change – AndresF Dec 20 '16 at 16:57
  • The problem could also be in external plugins. Have you tried profiling your site to determine what process is consuming so much memory? How big is the collection and how much filters are there? – Giel Berkers Dec 20 '16 at 17:01
  • Using 1G+ memory is pretty standard for Magento. Wouldn't surprise me at all if there's no plugins here whatsoever. – Eamonn Dec 20 '16 at 17:02
  • 2
    @EamonnHayden Nonsense. You'll see it on some imports and internal processes (like compilation), but not your average pageview. A standard frontend category request should not touch 300 MB, much less three times that. – Ryan Hoerr Dec 20 '16 at 17:28
  • Well all I know is from personal experience I crashed a fresh Magento install with only a couple products with nothing special done to it, just ~500mb of memory. – Eamonn Dec 20 '16 at 17:30

Sorry for late answer, but.

If you're using nginx, you can also check fastcgi parameters. There is a line from magento recommended nginx config that overrides default php.ini value:

  fastcgi_param  PHP_VALUE "memory_limit=768M \n max_execution_time=18000";

if you use apache, I think in the .htaccess there can be something similar

  • 1
    this help me with issue. – James M Apr 27 '18 at 9:37

Are you in production mode or development Mode ? If you are in production mode, sometimes the compile errors may result into this issue , please check into log files for any errors.


Increase the memory size in php.ini file .

  • Did you read the question? They already did that – DWils Dec 20 '18 at 17:17

It appears there are now .user.ini files in the docroot and pub folders, which override php.ini in the same way that .htaccess can.

PHP documentation on .user.ini files http://php.net/manual/en/configuration.file.per-user.php

And Magento issue reference: https://github.com/magento/magento2/issues/705

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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