Out of Memory Error with Many Shipping Methods in a Zone
-
In Woo 8.8+, we are running into a PHP (8.1) Memory Exhausted error when we have a large number of shipping methods available in a Zone. The error is triggered in Cart and Checkout when updating the destination state/postal code (appears to be an AJAX call). It can also be slow to update the cart when enough methods are active in the zone.
To trigger the error on our main site, add three products with different shipping methods to cart. Try Green Glue Compound Tubes first, then go to Cart and enter a shipping destination. Should be fine at this point. Next add a roll of MLV (AudioSeal Mass-Loaded Vinyl), and a box of PrivacyShield Ceiling Tile Barrier. Now that there are 3 items in cart with different shipping methods/instances, try changing the destination state & zip in Cart. This should trigger a spinner for 5–10 seconds but not actually update anything. Curiously if you subsequently go to the main shop page, it might update.
On our Staging site, we increased our WP_MEMORY_LIMIT from 512M to 2048M and this allowed more methods to be active at one time, but does not fully stop the issue nor does it speed things up.
As context our shipping setup is extraordinarily complex. We have 50 methods/instances available in the zone due to a combination of Parcel & LTL carriers, warehouses, and drop shippers (all with different origin zips and box sizes).
I have been able to reproduce the error on our Staging site with Storefront and minimal active plugins (Woo, TaxJar, UPS). It is always related to the number of active methods in the zone. The interesting thing is the error occurs in different places in Woo and WordPress depending on the number of active methods. See list below:
/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php on line 78
/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-shipping-method.php on line 531
/wp-content/plugins/woocommerce/includes/class-wc-post-data.php on line 19
/wp-content/plugins/woocommerce/includes/data-stores/class-wc-customer-data-store-session.php on line 109
/wp-content/plugins/woocommerce/includes/data-stores/class-wc-customer-data-store-session.php on line 119
/wp-content/plugins/woocommerce/src/Internal/Traits/AccessiblePrivateMethods.php on line 158
/wp-includes/class-wp-recovery-mode.php on line 367
/wp-includes/class-wp-hook.php on line 85
/wp-includes/class-wp-hook.php on line 97
/wp-includes/functions.php on line 650
/wp-includes/functions.php on line 4329
/wp-includes/load.php on line 412
/wp-includes/option.php on line 204
/wp-includes/plugin.php on line 173Any ideas?
The page I need help with: [log in to see the link]
- The topic ‘Out of Memory Error with Many Shipping Methods in a Zone’ is closed to new replies.