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. Commented Jan 18, 2018 at 13:03

7 Answers 7


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
    Commented Dec 20, 2016 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
    Commented Dec 20, 2016 at 16:59
  • Only has one memory_limit in php.ini
    – AndresF
    Commented Dec 21, 2016 at 7:49
  • 1
    Is this on shared hosting? Your provider might be limiting it in that case.
    – Eamonn
    Commented Dec 21, 2016 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
    Commented Dec 20, 2016 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? Commented Dec 20, 2016 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
    Commented Dec 20, 2016 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
    Commented Dec 20, 2016 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
    Commented Dec 20, 2016 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
    Commented Apr 27, 2018 at 9:37
  • @spillmusic May i know where i need to add this? either nginx PHP or in Magento. If you share the file path and some detail information will much appreciated
    – senthil
    Commented Mar 26, 2022 at 9:35
  • @senthil it's hardcoded in the default Magento config for nginx. Try find it in /etc/nginx/conf.d/ directory
    – spiilmusic
    Commented Mar 27, 2022 at 18:07

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
    Commented Dec 20, 2018 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 and acknowledge you have read our privacy policy.

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