• Resolved rb1958

    (@rb1958)


    There was a update to WP 4.3 and all Plugins are on currrent level.

    After the update no administration was possible, i’m receiving directly after login the following error:

    Fatal error: Out of memory (allocated 61865984) (tried to allocate 1573063 bytes) in /homepages/xx/xxxxxxxxxx/htdocs/xxx/wp-includes/wp-db.php on line 1092

    So it used 59MB und tried to allocate additional 1.5MB which failed. Looking at phpinfo() ist shows me that PHP Limit ist set to 120MB. I’m running on shared space not on a server. I’m using MySQL 5.0.11 and PHP 5.5.26.

    The questions is now why WP fails at 59MB when the linit is 120MB.I coded a define(‘WP_MEMORY_LIMIT’, ‘120M’); in wp-config.php to force WP to use all the 120MB available, but that changed nothing.

    Trying to set the PHP-Limit in .htaccess (php_value memory_limit 120M) leads to a Code 500 error.

    As usual, the Browser Cache was cleared, a new login was made and i tested with several browsers. All unneeded Plugins are disabled (Things like Buddypress, bbPress and Wordfence cannot be disabled without bringing the site to maintenance mode). After deleting the plugin WP-Statistics i could login and do that.

    Since that time the problem is intermittend which makes it much more difficult to test. Trying a reinstall of WP-Statistics for testing runs directly into the out of memory error.

    Same configuration (including WP-Statistics) has run without any problem on WP 4.2.x

Viewing 15 replies - 1 through 15 (of 15 total)
  • Moderator t-p

    (@t-p)

    Is this your own server?

    OR, are you on a shared hosting?

    If on a shared hosting, ask your hosting provider if you can effective increase memory like that.

    Thread Starter rb1958

    (@rb1958)

    As i described i’m running on shared space. And why should i request a higher amount of php memory when the available php limit is double as high as WP requests?

    Pls read my ticket carefully.

    Not seen this before on wp-db.php specifically, however, as you’re on shared hosting, it may be that the host limits your MySQL disk space, separately from your actual account disk space.

    Might be worth asking them about that.

    Thread Starter rb1958

    (@rb1958)

    Hm, MySQL Disk Space is 1054MB with 966.53 MB available.

    Brought the site to maintenance mode this morning, disabled all plugins and re-installed WP 4.3. Then i enabled one plugin after the other till the problem occurs. Then disabled all again and changed the sequece of the plugin activation. The result is that i could not identify a specific plugin cauing the problem. Depending on the activation sequence it is Wordpfence, WP-Statistics, buddypress, bbpres…..

    The only thing that changed after re-installing, is that the error occurs addtionally on line 1173 in wp-db.php from time to time. This looks very strange for me and currently i have no idea what can be done to find out whats wrong.

    The only thing i can say that with WP 4.2.4 all worked fine.

    Thread Starter rb1958

    (@rb1958)

    I forgot something. This morning i let Wordfence make full scan of the site. There are no modified files or any other security issue.

    FYI, might try adding the following to your theme’s functions.php just to see how much memory PHP thinks it is using:

    function memory_stats()
    { // BEGIN function memory_stats
       if ($_SERVER['REMOTE_ADDR'] == HOME_IP) {
          echo '<p style="clear: both;">Memory used: '. number_format(memory_get_usage(true)). ' bytes.<br />';
          echo 'Peak Memory used: '. number_format(memory_get_peak_usage(true)).' bytes.</p>';
       }
    } // END function memory_stats
    
    add_action('in_admin_footer', 'memory_stats');

    You can also call memory_stats() in footer.php to see how much the front-end uses. You can remove the if statement if you don’t want to check against your IP address.

    Thread Starter rb1958

    (@rb1958)

    Thanks for the function. Need to remove the if for the ip adress to get a display (i’m running via Cloudflare). Here is the result:

    Memory used: 49,545,216 bytes.
    Peak Memory used: 61,865,984 bytes.

    Hm, the peak memory is exactly the value which arises in the error message. I’m using Generate Press as theme.

    Thread Starter rb1958

    (@rb1958)

    And here is the result for the frontend:

    Memory used: 46,661,632 bytes.
    Peak Memory used: 50,069,504 bytes.

    But the frontend was never affected, i only had the problem in the backend.

    Thread Starter rb1958

    (@rb1958)

    Additional info:

    I installed the plugin WP-Memory-Usage which gives me some info in the dashboard and in the admin footer. Here is the result:

    PHP Version : 5.5.28 / 32Bit OS
    Memory limit : 120 MB
    Memory usage : 41.31 MB

    and the output of the memory function at the same time in the dashboard:

    Memory used: 50,855,936 bytes.
    Peak Memory used: 62,128,128 bytes.

    Hope this helps.

    Thread Starter rb1958

    (@rb1958)

    Found the solution in a 7 year old ticket:
    https://www.ads-software.com/support/topic/php-fatal-error-out-of-memory-in-wp-includeswp-dbphp

    The procedure ist as follows:

    – Go into the database and locate table YOUR_PREFIX_options
    – Make a backup of this table to have a fallback when something went wrong
    – Locate there the field cron
    – The option_value of this field contains something like that: a:3222:{i:1434543037;a:1:{s:20:”jetpack_clean_nonces”;a:1:{s:32:”40cd750bba9870f18aada2478b24840a”;a:3:…..
    – Delete all this, change it to 0 and save the table.

    In my case there was hundreds of such entries, more than 1MB of data. After doing this i was able to re-activate respectively re-install all plugins which worked before. All works fine now and hope this will be so in future.

    Now i have a feeling that the whole backend is working faster.

    My question(s) before marking this ticket as resolved is: What is written into this field and why?

    Does it make sense to clean up this field from time to time,ideally when updating to a new wordpress version?

    Thanks to all here for your support.

    That just appears to be stored security tokens from the JetPack plugin.

    I recommend contacting JetPack support and linking them to this thread, if it is the JetPack ones you had in your database.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Locate there the field cron

    If your cron was that big, you are likely experiencing the batch split terms bug in 4.3.

    Deleting the cron option is not the recommended fix, and is only a short term solution. To fix it permanently, follow these instructions:

    https://www.ads-software.com/support/topic/high-cpu-load-after-update-to-v43?replies=17#post-7330770

    Thread Starter rb1958

    (@rb1958)

    @atomicjack: not only jetpack was affected

    @samuel Wood: Thanks a lot for the patch

    After updating wordpress 4.4, it is impossible to view the report woorcommerce is the message:

    Fatal error: Out of memory (allocated 123207680) (tried to allocate 1265912 bytes) in /homepages/22/d501594221/htdocs/clickandbuilds/WordPress/tshirtdef/wp-content/plugins/woocommerce-export/index.php on line 223

    Please, how to proceed?

    Moderator t-p

    (@t-p)

    @dee97,

    If you noticed, this is thread is marked “resolved”.

    If the above info didn’t help you, then, as per the Forum Welcome, please post your own topic. That way you stand a good chance of getting full attention to your specific issue. Despite any similarity in symptoms, your issue is likely to be completely different because of possible differences in physical servers, accounts, hosts, plugins, theme, configurations, etc. Thus one problem, on one setup is not indicative of the functionality and reliability of an application as a whole.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Sincd WP 4.3 Fatal Error: Out of Memory in wp-db.php’ is closed to new replies.