Forums

[resolved] Strange error message [fatal error: allowed memory size...] (15 posts)

  1. gideonstrumpet
    Member
    Posted 5 years ago #

    Hi all, all of a sudden a few minutes ago, I started getting this error message:

    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 7680 bytes) in /home/apublic1/public_html/wp-includes/pluggable.php on line 256

    The url is: http://apublicdefender.com

    I have NO idea what it means and how to fix it. Can anyone help? Please?

  2. pizdin_dim
    Member
    Posted 5 years ago #

    Please use the search feature, this is a common problem.

  3. drmike
    Member
    Posted 5 years ago #

    Google as well. It's a PHP issue.

  4. gideonstrumpet
    Member
    Posted 5 years ago #

    Haha. Unbelievable. Sorry!

  5. gideonstrumpet
    Member
    Posted 5 years ago #

    Well, I increased the memory size in php.ini from 8MB to 16MB and it fixed itself.

    Does anyone know if this is a permanent fix or whether I will have to keep doing this in the future?

    Thanks for pointing me in the right direction. My apologies for not doing a search - I figured since it seemed so weird, that it was rare.

  6. pizdin_dim
    Member
    Posted 5 years ago #

    It's a permanent fix until you upgrade PHP. The default is still set to 8MB and that does work with some applications, although that number is less and less. Generally, I've found 16MB should be the minimum and 32MB about right. If you're in a shared hosted environment (with a cheap/crappy host), it may be futile to try and get them to increase it.

  7. gideonstrumpet
    Member
    Posted 5 years ago #

    I've upped it to 16MB. I asked the host about whether there was any limit at which point they'd cut off memory, but they said there was none. I'll change it to 32, just to be safe. Thanks for all your help!

  8. h3h
    Member
    Posted 4 years ago #

    The "increase PHP's memory limit" response is definitely not a long term solution. I increased the limit up to 256MB and still got the fatal error.

    I also set output_buffering = Off in php.ini (and verified the setting with a phpinfo()) and the problem remains.

    There must be some horribly unoptimized code in WP's admin section or some PHP setting that conflicts with how WP does things.

  9. Chris_K
    Member
    Posted 4 years ago #

    Not to that extent.

    So, what plugins are you running?

  10. whooami
    Member
    Posted 4 years ago #

    I concur with handy's observation. Memory issues are certainly not the most "popular" problems with WordPress -- which points more to a leeky plugin rather than to WP itself.

    PS: assuming the site in question is the one in his profile, his plugin directory is browsable.

    There isnt alot there, but there is a sitemap -- wasnt that an issue earlier?

  11. h3h
    Member
    Posted 4 years ago #

    Hmm. Thanks for the heads up -- directory indexes are now disabled.

    That said, I dove into the wp-admin code a bit and I now feel sick to my stomach. The database interaction code for comment moderation specifically is unbelievably terrible from a performance perspective.

    For every comment in the moderation queue, when moderating the queue, WordPress does the following:

    1. wp_set_comment_status(): 1 db query
    2. wp_update_comment_count(): 2 db queries
    3. get_comment: 1 db query
    4. get_post: 1 db query

    That's 5 queries for every single comment in the moderation queue, so 5N queries in total, including a COUNT(*) -- ouch, who missed that day in database class? This is embarrassing.

    This should be done with a worst case scenario of N + 1 queries, and that's only without modifying how comment counts are stored. Realistically this should be reduced to 2 queries for any number of comments in the moderation queue (total, not per comment).

  12. Chris_K
    Member
    Posted 4 years ago #

    And yet it all runs in well under 8MB.

    So, focusing back on the issue at hand (256MB not enough?): What plugins are you running?

    And, if you're running one of the google map ones, do you have the latest version?

  13. Rookietime
    Member
    Posted 4 years ago #

    Being new, can someone tell me where to find the PHP ini in order to raise the memory limit? Is it in the edit plugin section of the Google sitemap plugin? Sorry, but new at this.

  14. Rookietime
    Member
    Posted 4 years ago #

    Solution found. Updated plugin and works fine.

  15. olofw
    Member
    Posted 4 years ago #

    This thread helped me. Couldn't even get to wp-admin so I moved plugins out of the plugin directory on the server one by one until it worked again and thus I knew which one was causing the error. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags