Skip Navigation

[Resolved] Allowed memory size exhausted error from Toolset Types loader

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 3 voices.

Last updated by Waqar 7 months, 2 weeks ago.

Assisted by: Waqar.

Author
Posts
#2696301

I am trying to: normal use of the website

Link to a page where the issue can be seen: you can't see the error on screen but it goes to the log file

I expected to see: no issues with the site

Instead, I got: the following error being logged repeatedly even after raising the memory limit first to 256M then to 320M. I replaced the client account name in the paths below with ------. Otherwise this is exactly what shows up in the WooCommerce fatal-errors log:

2024-05-07T18:06:19+00:00 Critical Allowed memory size of 335544320 bytes exhausted (tried to allocate 20480 bytes)
Additional context
{
"error": {
"type": 1,
"file": "\/home\/------\/public_html\/wp-content\/plugins\/types\/vendor\/toolset\/types\/embedded\/classes\/loader.php",
"line": 91
},
"backtrace": [
{
"file": "\/home\/------\/public_html\/wp-content\/plugins\/woocommerce\/includes\/class-woocommerce.php",
"line": 378,
"function": "critical",
"class": "WC_Logger",
"type": "->"
},
{
"function": "log_errors",
"class": "WooCommerce",
"type": "->"
}
]
}

#2696429

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Looking at the plugin source code pertaining to the error, it looks like it is related to caching post meta values for posts returned by some query.

Which leads me suspect that the site has a lot of post meta.

How big is the wp_postmeta table?

If the site is very large, it may simply need more resources, and you would need to raise the available memory further, e.g. to 512Mb.

#2696477

Does it cache the entire postmeta table, not just the rows with relevant keys, every time? Such that all the meta for all the WC orders gets cached whether needed or not? That could explain the issue but having to buy a bigger server to solve that v. having a smarter caching aaproach seems expensive.

#2696650

Hi,

> Does it cache the entire postmeta table, not just the rows with relevant keys, every time?

- The function in question, caches all the custom field values for the posts returned by a WordPress query.

This means that if there are too many posts, too many custom fields, and/or too long custom field values, more processing memory will be needed.

Have you tried increasing the available memory to 512Mb, as Nigel recommended?

regards,
Waqar

#2696739

Yes, I increased it to 512M and still got the memory exhausted error. 512M is larger than the entire database.

#2697058

Ok, in that case, we'll need to examine the custom fields that are involved here.

Can you please share the temporary admin login details of the website? I'll also need your permission to download its clone/snapshot, to troubleshoot this on a different server too.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

#2697411

There is a lot of cusotmer data on this server so not sure I can share access / allow a clone. I'll check with the client. However, I haven't had a memory exhausted error in a few days. I think the memory problem was caused by a UPS Shipping plugin, not by Toolset even though it got logged as a Toolset error in the log. The UPS Shipping Plugin provider issued an update and it seems to have solved the memory issue.

I will keep an eye on it for a few days and if there are no more errors you won't need access and can close this ticket.

#2697414

Thanks for the update and glad that it looks sorted.

Let us know if you need any further assistance.