I am dealing with a Wordpress site that shows regular out of memory errors when navigating the control panel.

I am asking a question about it here because I have tried all the usual options: checking the memory assigned by the server both from the server and via phpinfo, using WP-DEBUG and the Query Monitor plugin. It's not the theme or the page content, because it's happening on the admin interface, not the public one.

I would like to know about other issues that might be restricting memory usage that I can investigate this further.

I have define( 'WP_MAX_MEMORY_LIMIT', '768M' ); set in wp-config.php a php info check shows the memory limit on the server as 768M. I have checked the server logs, which say the account has come nowhere near its 2Gb account memory limit in the last seven days.

The site is only trying to allocate fairly small amounts of memory : not more than about 25Mb. The errors look like:

PHP Fatal error: Out of memory (allocated 2359296) (tried to allocate 12288 bytes)

PHP Fatal error: Out of memory (allocated 11272192) (tried to allocate 12288 bytes)

That surely should not be a problem on a site with these resources. There's no consistency on which file or plugin is mentioned in the error log.

And yet, I'm getting these out of memory errors. I don't know where else to look!

Can anyone suggest what I am missing? I have reworded this question to make it clearer what I have already tried, and explain why I think this question is generally useful.

  • did you turn on debugging and see what is causing the errors. Can you look at your hosting (appache?) error log? – pressword Dec 5 '17 at 0:56
  • It's not possible to tell using just the information in your question, there's a lot of debugging work you need to do, for all we know every page load resizes images, makes remote requests, and fetches 10,000 posts from the database. Also verify that you actually have upped the limit instead of assuming the wp-config define worked – Tom J Nowell Dec 5 '17 at 2:10
  • Yes, I looked in the apache log. There's nothing there, except the memory errors themselves, which refer to a different file each time. The memory errors are happening in the admin interface, not the public site. For example, it happened last night when I looked at the list of plugins. As I mention above, I did do a phpinfo check to ensure that the memory really was being made available, and it is listed as available in phpinfo, I also checked the php configuration for the server. – Victoria Dec 5 '17 at 9:39
  • I did say 'navigating the control panel' in my original question but perhaps it was not clear enough that this is a problem I'm seeing in the back end only. It's not related to page content or theme at all. I get it saving a page or pulling up the list of plugins. – Victoria Dec 5 '17 at 14:49
  • I will ask again to have a sure. Does your phpinfo(); function executed from vhost where your site is (e.g. inside info.php file placed in the root of your project) is returning config with directive memory_limit set to 768M ? – kierzniak Dec 5 '17 at 15:13

Your Answer

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

Browse other questions tagged or ask your own question.