2

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?

Thanks

asked Dec 20, 2016 at 16:39
1
  • 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

2

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.

answered Dec 20, 2016 at 16:49
4
  • It is changed, but it not working 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 Commented Dec 20, 2016 at 16:59
  • Only has one memory_limit in php.ini Commented Dec 21, 2016 at 7:49
  • 1
    Is this on shared hosting? Your provider might be limiting it in that case. Commented Dec 21, 2016 at 9:05
1

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.

answered Dec 20, 2016 at 16:45
1

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?

answered Dec 20, 2016 at 16:51
7
  • It is in the core in magento, It is supposed to work if it does not change 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. 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. 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. Commented Dec 20, 2016 at 17:30
1

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

answered Jan 18, 2018 at 12:53
3
  • 1
    this help me with issue. 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 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 Commented Mar 27, 2022 at 18:07
1

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.

answered Jan 18, 2018 at 12:55
1

Increase the memory size in php.ini file .

answered Mar 23, 2018 at 6:36
1
  • Did you read the question? They already did that Commented Dec 20, 2018 at 17:17
0

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

answered Dec 20, 2018 at 17:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.