• For some reason my site RAM usage upon page load increases substantially for no apparent visible reason

    Query Monitor will show either admin or frontend using something below 50MB… and then… sometime later… it starts jumping up on page loading… to using over 150MB.

    I’ve been troubleshooting for weeks. No clue what causes this – server or install.

    Decent spec VPS

    I’ve got several WP multisites using 5.9.x and php8 or php7.4 showing the same thing. Switching between php versions resets the RAM usage to ‘normal’, and then it starts creeping up again.

    I’ve disabled wp-cron.php and use server cron triggering wp-cron-multisite.php triggering every 10 minutes – I can’t associate the increase as being caused by cron, but maybe it is

    site is heavy on plugins – but well optimized. If I disable all plugins of course RAM usage is lower… then enabling them the usage grows and grows right up to the highpoint (ie not resetting at normal below 50MB)

    issue happens whether page caching is enabled or not

    not even sure where to look or guess at.

    I will be deploying script restrictions on particular pages to see if they are affected – but I’m wondering if the server isn’t clearing something out (hosting support used to be great, now they are nearly worthless)

    any ideas? thnx

    • This topic was modified 2 years, 7 months ago by rapidasia.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    If I disable all plugins of course RAM usage is lower… then enabling them the usage grows and grows…

    Have you tried enabling one by one to see if one in particular is responsible? Or does max. memory usage incrementally creep up over time after each one is enabled? It could be one is starting sessions but not properly finishing them for example.

    Thread Starter rapidasia

    (@rapidasia)

    @bcworkz

    sorry for delay in replying

    I’m pretty sure something is starting something and not finishing it… ha ha but no clue how to narrow that down other than an impossible slow trial and error of disabling plugins.

    part of the troubleshooting headache is I can’t get the peak memory usage to completely reset if disabling plugins… caching or some cron job over time needs to take place.

    I thought maybe something would show up in database logs but my host was useless in diagnosing this

    I’ve trying to assess cron jobs now but it’s completely a fire drill exercise in futility

    Thread Starter rapidasia

    (@rapidasia)

    @bcworkz

    just a quick note — as I had suspected it appears this is related to cron, but no idea what specific action it is related to

    I changed from server cron to wp-cron (just to narrow the problems down)

    and using WP Crontrol I deleted any cron job that looks like it was left over or empty

    nothing seemed to do anything… but upon returning to the site hours later, the Peak Memory Usage has dropped back down to normal level.

    so now of course I await with baited breath if it decides to start jumping back up

    Moderator bcworkz

    (@bcworkz)

    So apparently there’s memory creep with server cron but not wp-cron? All I can imagine is something isn’t freeing memory when it’s finished, but wp-cron somehow manages to do that anyway. If you’re OK with wp-cron (and it continues to work without memory creep), I guess the issue is resolved without finding the root cause.

    If you need to revert back to server cron, you still may be stuck with the tedious plugin deactivation routine to narrow down the cause. FWIW, the Health Check and Troubleshooting plugin can help with this. It deactivates plugins for your view only, other visitors still see the site with all plugins active. The plugin has a menu bar element where restoring plugins one by one is relatively easy. The problem is I’m unsure if it’ll work properly with server cron issues since it’s external to WP.

    Thread Starter rapidasia

    (@rapidasia)

    thanks – good tip

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘mysterious increases in page load RAM usage’ is closed to new replies.