Support » Fixing WordPress » Fatal error: Allowed memory size of 268435456 bytes

  • Resolved enquirer32


    Hi. There are posts about this all over the internet. None of the solutions seem to work. I don’t think this is about any kind of memory allocation – is it a bug in wordpress. Perhaps we could collect everyone’s views here and see what can be done about it?

    Many thanks.

    (error message: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 44 bytes) in /home…/wp-includes/wp-db.php on line 1402

    Can anyone help?

Viewing 7 replies - 1 through 7 (of 7 total)
  • There’s a very good chance that it’s not anything to do with WordPress. Every time that I’ve seen that error in my sites it’s been from a plugin or theme file that’s doing something wrong. That value tells me that whatever file is running there is trying to allocate over 256MB or memory, and that says that there is something very wrong.

    The best way to check this is to disable your plugins, and enable them one-by-one to see which one is causing that error. Unfortuantely, once you find the error are either removing the plugin, waiting until there’s an update that fixes the problem, or you fixing the problem yourself.

    Tried that.. didn’t work. Thanks anyway.

    OK. If you’ve arrived here from somewhere on the web you will already know that this issue is widespread and isn’t only a WordPress issue. I have spent several days on this issue and received prompt, courteous and knowledgeable help from my hoster GoDaddy.

    I think the way to troubleshoot this problem (and resolve it – because I have) is as follows – I would suggest doing it in this order.

    First, this isn’t necessarily a memory issue. Spending time on this right from the start won’t help. You will doubtless have tried this already. Fine, something to do in the future.

    Next: BACKUP your database.

    If you’re using WordPress I would install a plugin WPPhpMyAdmin – I use it all the time and it saves logging into to another screen – you can always open up other tabs to your site in the your browser.

    1) From within phpMyAdmin browse your database. You should automatically be in the ‘Structure’ screen – just look down at the various ‘Records’ – nothing should seem too large. I had a huge number of items in my ‘postmeta’ records – this was the source of my problem.

    2) Browse the ‘postmeta’ records. You are likely to see the problem – I had a huge number of entries under some kind of hash reference, might be a ping cache, lots of things. One way to identify this is by clicking on the column ‘metakey’ which will run everything in alphabetic order.

    3) If this is the case then run a script from within the ‘SQL’ tab : DELETE FROM wp_postmeta WHERE meta_key = ‘YourMetaKey’;

    where ‘YourMetaKey’ refers to the ‘metakey’ which you’ve identified as holding all these pointless records.

    4) The problem should go away.

    5) Keep your database nice and clean. These are some of the best tools for this:

    WP Cleanup – if you only want one plugin – this is the one.
    WP Optimize – you don’t really need this if you’ve the one above.
    WPDBSpringClean – keeps those plugins at bay which you’ve uninstalled.
    WPMassDelete – helpful for getting rid of old posts.

    And, I’m sure I don’t need to say this: backup, backup, backup. And, oh yes, backup!

    If this helps you as much as it might have helped me a week ago then I will have paid back something to a community which has helped me along all these years.

    Hello everyone,

    But we cant delete our post meta enteries.

    All are required.

    I am facing Same problem.

    Please help

    I also edit define(‘WP_MEMORY_LIMIT’, ‘1028M’);

    Well, I am sure that this is not the case… try Wp-optimize and delete post revisions for a start (assuming you may not need these?). Take a deep look into your wp-postmeta and see if something isn’t being generated you may not need…

    Not working for me either – did anyone solve this memory limit problem? Putting it up to 1.5GB solves nothing. Something in WP apparently is shutting it down at 256MB and won’t allow me to simply set the users. I have over 50,000 in about 10 blogs but this should not be a problem at all.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error: Allowed memory size of 268435456 bytes’ is closed to new replies.