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:
and this catalog:
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?
Thanks
-
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– Tero Lahtinen2018年01月18日 13:03:55 +00:00Commented 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 workingAndresF– AndresF2016年12月20日 16:58:07 +00:00Commented 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.iniEamonn– Eamonn2016年12月20日 16:59:36 +00:00Commented Dec 20, 2016 at 16:59 -
Only has one memory_limit in php.iniAndresF– AndresF2016年12月21日 07:49:01 +00:00Commented Dec 21, 2016 at 7:49
-
1Is this on shared hosting? Your provider might be limiting it in that case.Eamonn– Eamonn2016年12月21日 09:05:42 +00:00Commented Dec 21, 2016 at 9:05
You can check your memory limit by creating a phpinfo.php in the pub folder file.
Example:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
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 changeAndresF– AndresF2016年12月20日 16:57:47 +00:00Commented 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?Giel Berkers– Giel Berkers2016年12月20日 17:01:22 +00:00Commented 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– Eamonn2016年12月20日 17:02:53 +00:00Commented 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– Ryan Hoerr2016年12月20日 17:28:40 +00:00Commented 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– Eamonn2016年12月20日 17:30:31 +00:00Commented 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
-
1this help me with issue.James M– James M2018年04月27日 09:37:56 +00:00Commented 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 appreciatedsenthil– senthil2022年03月26日 09:35:17 +00:00Commented 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/ directoryspiilmusic– spiilmusic2022年03月27日 18:07:55 +00:00Commented 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 thatDWils– DWils2018年12月20日 17:17:39 +00:00Commented 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