• Resolved trevellfr

    (@trevellfr)


    Hi all !

    Some days I have this kind of error in the woocomerce log :

    025-06-05T14:16:39+00:00 Critique Allowed memory size of 536870912 bytes exhausted (tried to allocate 4096 bytes)
    Contexte supplémentaire
    {
    "error": {
    "type": 1,
    "file": "/home/******/wp-includes/meta.php",
    "line": 1206
    },
    "remote-logging": true,
    "backtrace": [
    {
    "file": "/home/******/wp-content/plugins/woocommerce/includes/class-woocommerce.php",
    "line": 414,
    "function": "critical",
    "class": "WC_Logger",
    "type": "->"
    },
    {
    "function": "log_errors",
    "class": "WooCommerce",
    "type": "->"
    }
    ]
    }
    2025-06-05T14:16:45+00:00 Critique Allowed memory size of 536870912 bytes exhausted (tried to allocate 4096 bytes)
    Contexte supplémentaire
    {
    "error": {
    "type": 1,
    "file": "/home/******/includes/meta.php",
    "line": 1206
    },
    "remote-logging": true,
    "backtrace": [
    {
    "file": "/home/******/wp-content/plugins/woocommerce/includes/class-woocommerce.php",
    "line": 414,
    "function": "critical",
    "class": "WC_Logger",
    "type": "->"
    },
    {
    "function": "log_errors",
    "class": "WooCommerce",
    "type": "->"
    }
    ]
    }

    Is it a big issue ? Can I fix it ?

    Best, Bruno.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @trevellfr,

    The error you’re encountering indicates that your WooCommerce setup is running out of PHP memory while processing certain tasks. Specifically, the message “Allowed memory size of 536870912 bytes exhausted” means your site hit the 512 MB memory limit set for PHP and tried to allocate more memory but failed. This usually happens during intensive operations involving product or order metadata, as suggested by the error occurring in the meta.php file.

    This kind of issue can arise due to a large number of products, orders, or metadata being processed, or because of inefficient queries or conflicts with plugins. It might also be caused by logging functions or scheduled tasks that use more memory than expected. In some cases, custom code or themes can contribute to memory leaks or excessive usage.

    To address this, the first step is to consider increasing your PHP memory limit, if your hosting environment allows it. You can increase the memory limit by adding the following line to your wp-config.php file, just before the line that says /* That’s all, stop editing! Happy publishing. */:

    define( 'WP_MEMORY_LIMIT', '768M' );

    If you need to increase the PHP memory limit via your php.ini file, add or update this line:

    memory_limit = 768M

    Or, if your host uses .htaccess, you can try adding:

    php_value memory_limit 768M

    Additionally, check for plugin conflicts by temporarily deactivating all plugins except WooCommerce, then reactivating them one by one to identify if any specific plugin causes excessive memory use. Using debugging tools such as Query Monitor can help you identify resource-heavy queries or processes.

    Optimizing your WooCommerce database by cleaning up unnecessary data, expired transients, and old sessions can reduce memory demands. You can use plugins like WP-Optimize or Advanced Database Cleaner to assist with this cleanup. Also, review scheduled actions under WooCommerce > Status > Scheduled Actions to ensure no tasks are stuck or failing repeatedly, as these can increase memory usage.

    Kindly implement the suggestions above and let me know how it goes.

    Thread Starter trevellfr

    (@trevellfr)

    Hi,

    I made a cleanup of the database, and for the moment, everything is fine!

    Thank you.

    Hi @trevellfr,

    Thank you for the update. I’m happy to hear that cleaning up the database helped and things are running smoothly now!

    If WooCommerce has been helpful for your store and you’ve appreciated the support received, we’d be grateful if you could leave us a quick review here: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/#new-post

    Thanks again, and feel free to reach out anytime you need assistance!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Critique Allowed memory size’ is closed to new replies.