• PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32466464 bytes) in ***/wp-content/plugins/pixel-caffeine/includes/product-catalogs/feed/class-xml-writer.php on line 134

    This isn’t happening constantly, but it has happened more than once.

    Maybe it’s because we have nearly 4k products being included in the feed…
    Is there any way to prevent this memory error?

    Plugin version: 2.0.8
    Store: Woocommerce
    WC version: 3.7.0
    WP Version: 5.2.4

    site:
    https://www.poolwarehouse.com/

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    you could try to activate the “Save in background” option, in order to allow the system to save in little chunks: https://snipboard.io/kFDe4L.jpg

    Thread Starter bheadrick

    (@bheadrick)

    I saw that option initially, and I thought I had enabled it, but apparently not.

    after enabling that and saving, I see this:

    [07-Nov-2019 18:31:21 UTC] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /app/public/wp-includes/meta.php on line 952
    [07-Nov-2019 18:31:21 UTC] PHP Stack trace:
    [07-Nov-2019 18:31:21 UTC] PHP   1. {main}() /app/public/wp-admin/admin-ajax.php:0
    [07-Nov-2019 18:31:21 UTC] PHP   2. do_action() /app/public/wp-admin/admin-ajax.php:173
    [07-Nov-2019 18:31:21 UTC] PHP   3. WP_Hook->do_action() /app/public/wp-includes/plugin.php:465
    [07-Nov-2019 18:31:21 UTC] PHP   4. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:310
    [07-Nov-2019 18:31:21 UTC] PHP   5. AEPC_Admin_Ajax::ajax_get_posts() /app/public/wp-includes/class-wp-hook.php:286
    [07-Nov-2019 18:31:21 UTC] PHP   6. get_posts() /app/public/wp-content/plugins/pixel-caffeine/includes/admin/class-aepc-admin-ajax.php:606
    [07-Nov-2019 18:31:21 UTC] PHP   7. WP_Query->query() /app/public/wp-includes/post.php:1961
    [07-Nov-2019 18:31:21 UTC] PHP   8. WP_Query->get_posts() /app/public/wp-includes/class-wp-query.php:3404
    [07-Nov-2019 18:31:21 UTC] PHP   9. update_post_caches() /app/public/wp-includes/class-wp-query.php:3163
    [07-Nov-2019 18:31:21 UTC] PHP  10. update_postmeta_cache() /app/public/wp-includes/post.php:6416
    [07-Nov-2019 18:31:21 UTC] PHP  11. update_meta_cache() /app/public/wp-includes/post.php:6434

    but on the plus side, it does look like the feed built successfully.
    I’ll have to wait until the next update to see if it continues to build successfully.

    One issue, is that because the build failed at some point, the .tmp file was in the directory, so the “in progress” message was in the panel, making it impossible to look at/edit the settings.
    I had to dig through the code to find out that the tmp file being there is what caused that message to display.

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Ok, let’s try to reduce the number of products saved in one process. To do that, the only way, unfortunately, is changing it in the plugin code, though it will be useful to me to understand if it solves the problem and then I’ll give a way to change it.

    Open the plugin file wp-content/plugins/pixel-caffeine/includes/product-catalogs/class-configuration-defaults.php and find the line:

    
    Configuration::OPTION_CHUNK_LIMIT => 1000
    

    Change that 1000 to something less, such 500 or less, until the error goes away.

    Let me know if you can solve that in this way and I’ll prepare a fix for that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘xml writer exhausted allowed memory’ is closed to new replies.