Large orders give memory_limit exhausted

  • Posts: 62
  • Thank you received: 1
6 years 3 months ago #287303

-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.4
-- PHP version -- : 7.0.23
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1769472 bytes) in /var/www/vhosts/groenehartcooperatie.nl/httpdocs/libraries/joomla/database/driver.php on line 2049, referer: groenehart.dpz-server.nl/afrekenen/task-step/step-1

Hello,

When a customer does a large order, it seems the webshop runs out of memory. Currently the PHP memory_limit is set to 1GB (which is pretty large) and still the webshop occasionally runs out of memory. A large order is about 20-30 different products of about 10 different vendors (creating sub-orders for each vendor with Hikamarket).

The hosting has about 6 out of 8 GB available - so that should not be a problem.

When this error occurs, the parent order is created with the relevant products, but for each item/vendor the sub-order is not created and have to be added manually to correct the order.

Is this a webhosting issue, or is the Hikashop / Hikamarket checkout eating alot of memory when large orders come along?

Cheers,
Teeuwis

Please Log in or Create an account to join the conversation.

  • Posts: 81631
  • Thank you received: 13085
  • MODERATOR
6 years 3 months ago #287307

Hi,

Even with 30 products and 10 vendors it shouldn't eat that much memory.
1GB is really a lot.
HikaShop's order creation on a Joomla website, even with HikaMarket can work with 32/64 MB. Now with so much vendors, I could understand that you might need 128MB, maybe 256MB but 1GB seems disproportionated.
Do you have any other extension integrated with HikaShop on your website ?

Please Log in or Create an account to join the conversation.

  • Posts: 62
  • Thank you received: 1
6 years 3 months ago #287473

Checking other plugins got us on the right track.

We have a plugin who appends extra info to the order history with the trigger after the order is saved. It basically checks what has changed between the old order and the new order and logs this in the order history. I can imagine that will clog up allot of memory when it is triggered with each sub-order due to Hikamarket.

I have now disabled that plugin and we'll see how the memory consumption is coming days. Thanks for the tip!

Please Log in or Create an account to join the conversation.

  • Posts: 81631
  • Thank you received: 13085
  • MODERATOR
6 years 3 months ago #287493

Hi,

What you can do is add a check to skip the order entries with an order_type different from "sale".
We do that in a lot of plugins so that they are only doing their processing on the main orders and not the sub sales of HikaMarket.

Please Log in or Create an account to join the conversation.

Time to create page: 0.050 seconds
Powered by Kunena Forum