• Resolved alantygel

    (@alantygel)


    Hi,

    I have an application where I need to update a series of orders based on a joint information about theses orders.

    Thus I have to loop through several orders, and also loop each item, add some fees, and recalculate totals.

    In this process, memory usage is getting very high. An inspection using PHP’s memory_get_usage() revealed that some woocommerce functions use a lot of memory.

    For example, after calling $order->calculate_totals(), memory usage increases 15 to 30MB. For each order I have to call this method twice, and this explains why memory usage is exploding.

    My question is: is there something I can unset after each iteration in order to avoid so much memory usage being accumulated?

    best,
    alan

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Memory use by $order->calculate_totals() method’ is closed to new replies.