• Resolved swiftscsi

    (@swiftscsi)


    Hello, after the last update I’ve been receiving the following error when trying to save a new post:

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8192 bytes) in?xxx/OptimiseAssets/OptimizeCommon.php?on line?681

    There has been a critical error on your website. Please check your site admin email inbox for instructions.

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 147456 bytes) in?xxx/wp-includes/option.php?on line?402
    I tried increasing the memory to 512M from 256 but it didn’t help any suggestions? Thanks.
    I have version Version 1.3.5.1
    Wordpress 5.3

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @swiftscsi This error is generated when PHP’s RecursiveIteratorIterator class is called as it’s used to collect the files information from the /wp-content/cache/asset-cleanup/ (or whatever custom directory you’re using to store the cached CSS/JS files) directory when the caching is cleared (it happens once you save a post). The saving of the post should be fine. Please check if the updated information from that particular post was indeed saved.

    From my experience, this is a memory issue and increasing it should have fixed it. Did you restart the server so the PHP’s new settings would take effect? Otherwise, it could be that you have lots of files there and the script timeouts when it goes through them.

    Can you go to “Tools” – “Storage Info” and let me know how many files you notice they are mentioned there? I’ll be thinking of a way to clear the caching while using less memory.

    Thread Starter swiftscsi

    (@swiftscsi)

    Thank you for your response.
    Yes. Although I get the error the post still saves. Yes after increasing the PHP memory I did restart.
    Storage info says:
    Total cached CSS/JS files: 187898, 504.99 MB
    It’s a very large site approx 10,000+ pages but I did not realize that the total cache was 504.99 MB so 512M PHP mem may not be enough. I will try doubling it.

    Thread Starter swiftscsi

    (@swiftscsi)

    Setting the memory to 2,048?M has corrected it for now.

    Thanks for the help

    Plugin Author Gabe Livan

    (@gabelivan)

    @swiftscsi that’s impressive (the total number of files there), really! Note that if you have enabled both combine CSS/JS features, it’s the main reason why this added up.

    At the moment, the caching is cleared (all of it), whenever you update a post. However, in many instances, it might not be necessary to clear it all. For instance, you can update a post without doing any changes to the assets management list and clearing the cache in that situation is not necessary and thus you can save resources. If you have lots of visitors coming to that website at the particular moment when a post is updated, then (if those pages happen to be uncached and the WordPress environment is triggered, your visitors could end up seeing memory issue errors or have to wait longer for the pages to render).

    I’ll put optimizing the cache clearing as a high priority task so future versions of the plugin (Lite and Pro) will use less memory. I’ve noticed the same issue happening with large websites (mostly with lots of pages) and it’s something that will be improved for sure. After all, we’re talking about a performance plugin that should adapt to pretty much any situation.

    Thread Starter swiftscsi

    (@swiftscsi)

    It definitely is a performance plugin. We’ve tried one others along with manual disables and this is by far THE BEST. We are on a very fast google cloud instance so the extra mem was no problem. Thank you for your help. I look forward to purchasing the full version.

    Plugin Author Gabe Livan

    (@gabelivan)

    @swiftscsi I’m glad you like it! Just so you know, a gradual process of improving the clearing of the cache has been started. This will be improved over the release of the next tags. Extensive testing has to be made to be sure no issues of any kind will come up for anyone using the plugin, whatever hosting and optimization settings are used.

    For instance, the pagination pages for the homepage, categories and the archive pages (e.g. date, author) often return the same caching files, thus it would be redundant to have a directory and at least one caching file for each of the page numbers. That’s important for blogs with lots of posts. This alone will reduce the total number of files and directories significantly and less memory will be used to process the clearing of the caching.

    This has already been implemented and it will be pushed in the next tag. It should reduce the total number of files you have there.

    As for upgrading to the Pro version, there’s a Black Friday offer you may want to check that lasts until the 3rd of December, 2019: https://gabelivan.com/items/wp-asset-cleanup-pro/ (you can save between 15% & 20%, depending on the license type).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Error when saving post’ is closed to new replies.