WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] Fatal error: Allowed memory size exhausted (18 posts)

  1. vich11
    Member
    Posted 4 years ago #

    I see this listed as resolved, but it's not for me. I've been seeing the "Allowed memory size" error all over the place, and I have the memory_limit for php set to almost 400MB.

    Over at VPS.net they sent me this:

    We analyzed system logs, they show a problem with WP plugin 'w3-total-cache'.
    (PHP Fatal error: Out of memory (allocated 32243712) (tried to allocate 262109 bytes) in /home/site-a/public_html/wp-content/plugins/w3-total-cache/lib/W3/Cache/Apc.php on line 40).

    but I also got this (on a site not running total cache)

    Fatal error: Out of memory (allocated 34865152) (tried to allocate 193760 bytes) in /home/site-b/public_html/wp-content/plugins/post-plugin-library/common_functions.php on line 350

    and this

    Fatal error: Out of memory (allocated 34865152) (tried to allocate 17424 bytes) in /home/site-a/public_html/wp-includes/theme.php on line 180

    and this

    "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/site-a/public_html/wp-admin/includes/template.php on line 3317"

    I'm really at my wits end. I *want* to use W3 Total Cache, but it seems to keep fighting me and causing problems.

  2. Pascal Dreissen
    Member
    Posted 4 years ago #

    Look like you are running out of memory assigned to php. You need to update this setting in php.ini if you have the right to do so:

    memory_limit = 24M

    It is possible that there is another value on your server, update this to:

    memory_limit = 64M

    Restart http and you are done!

    If you cannot update php.ini, you can try to update it in .htaccess, i don't know if your host let's you do this, you need to check.

    php_value memory_limit 64M

    This is not w3tc related what so ever!

  3. vich11
    Member
    Posted 4 years ago #

    The memory limit in php.ini is set to 384MB and the limit in wp-config.php WAS set to 128MB, but I've removed the memory limit in the wordpress config file.

    Certainly even 128MB should be beyond sufficient?

  4. vich11
    Member
    Posted 4 years ago #

    Well I tried switching from APC to disk caching on W3 and my mysqld use went to 400% CPU and my cpu load spiked up to 7-8 and stayed there.

    I'm going to try uninstalling total cache and going back to supercache to see what that does.

  5. Pascal Dreissen
    Member
    Posted 4 years ago #

    Well I tried switching from APC to disk caching on W3 and my mysqld use went to 400% CPU and my cpu load spiked up to 7-8 and stayed there.

    Really strange. 384MB should be really sufficient :)

    I cannot explain why mysql should go nuts when switching to Disk caching. Maybe Frederick can explain this, but i am pretty sure it has nothing to do with W3TC.

  6. vich11
    Member
    Posted 4 years ago #

    Disk caching with supercache also caused the load to spike for some reason. Bizarre.

    So I can't do disk caching, and when I do APC I get memory errors.

    Awesome.

  7. Frederick Townes
    Member
    Posted 4 years ago #

    This is a very unique case and I'm looking into it.

  8. cogmios
    Member
    Posted 4 years ago #

    I had the same with e.g. supercache.

    One of the things to check is the amount of queries by placing the query checks in the footer. E.g. on average you should have something like 40 queries with some plugins this rises to 2500 queries e.g. pagebars.

  9. Frederick Townes
    Member
    Posted 4 years ago #

    Typically database activity is not going to exhaust your memory. Some scripts simply require a lot of memory to execute and if you have a poor combination of plugins or cumbersome theme you will see these issues. They do not relate to caching plugins. W3TC runs fine with <32M (the default I believe) memory for PHP with the default theme, which is how WordPress "ships."

  10. AlwaysWorking01
    Member
    Posted 3 years ago #

    FIXED IT!!!
    PRIOR to upgrading to 3.0

    Deactivate all plugins, install the "MEMORY BUMP" Plugin. Activate it, and then activate all other plugins, takes about a minute.

    Upgrade to 3.0 and it works!

    Tried this first without deactivating plugins and it didn't work.

  11. AlwaysWorking01
    Member
    Posted 3 years ago #

    Memory Bump Plugin is located at

    http://wordpress.org/extend/plugins/memory-bump/

    Sorry for not adding the link the first post.

  12. Frederick Townes
    Member
    Posted 3 years ago #

    Thanks for sharing!

  13. scotman
    Member
    Posted 3 years ago #

    Hmm well scratch the it worked part below. I installed memory dump and still getting this error. I'm using WordPress 3.0. I thought this whitescreen was due to a addon conflict but I'm getting memory errors like the above poster. So not sure what is going on.

    My server is a HostGator VPS Linux server.

    Thanks alwaysWorking been looking all over the place for a fix. Your awesome for leaving how you fixed it behind.

    Thanks fredericktownes for the awesome caching addon, I really appreciate all the hard work you put into it.

    Signing off.

    ~ Scot Manaher

  14. Frederick Townes
    Member
    Posted 3 years ago #

    Can you please submit a bug submission form from the support tab of the plugin?

  15. scotman
    Member
    Posted 3 years ago #

    Frederick just to follow up I did fix my issue..Going to leave the fix for others needing help. It was not actually your plugin causing this, atleast for me it wasn't.

    What I found after testing each plugin is the only thing tied to this error is the amount of memory each plugin uses. You can try and enable any plugin in any order and soon find out that it exhaust the usable memory limit that is set on your server. As you pass that 32m memory limit it throws a white screen. So here is how I fixed it.

    The fix is you have to edit the php.ini file via your WHM Cpanel Manager and navigate to PHP configuration editor and change the following...

    Core memory_limit

    -This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server.

    You want to set from 32m to 64m and all should be fine.

    For members...Just a warning if you don't know what I'm talking about just call up your host and ask them to increase your php memory limit.

    Now another fix which many don't want to hear is limit the number of addons you use. This will not only get rid of your white screen problem but it will also make your website load and run faster.

    I hope this helps. Cheers Frederick thanks again for all the work you do.

    Signing off.

    ~ Scot Manaher

  16. Frederick Townes
    Member
    Posted 3 years ago #

    Thanks Scot. I've noticed that lots of users of WHM / Cpanel are having trouble optimizing their server performance.

  17. scotman
    Member
    Posted 3 years ago #

    Yea I think so too. Plus if your on a shared server they don't allow alot of changes to configurations so you don't compromise the entire server. Dedicated server costs more but with the added support you can not beat it. Plus your allowed alot more freeway of making changes.

    Another thing and I don't mean to make this into a publication but I wanted to hit on was if your running Headspace2 then make sure your memory limit is not set to default under the Headspace site modules settings. Look for the system settings row and you can set it from default to whatever you may need it at.

    Well cheers. Thanks for the follow up Frederick!

  18. Frederick Townes
    Member
    Posted 3 years ago #

    No problem.

Topic Closed

This topic has been closed to new replies.

About this Topic