For past few month we are facing this below issue.
Allowed memory size of 3145728000 bytes exhausted (tried to allocate 4096 bytes)
WordPress core
File: /wp-admin/class-wp-term.php
Line: 184
Allowed memory size of 3145728000 bytes exhausted (tried to allocate 20480 bytes)
WordPress core
File: /wp-admin/class-wp-term-query.php
Line: 1133
We are large database we do have more terms but we repair/optimized the table constantly and removed unwanted things. But still we are facing this issue.
Hello. Thank you for contacting the Toolset support.
I'm not sure if Toolset involved here as it seems you have too many terms available and due to that you see the error you shared.
Where do you see the error you shared - is it in the backend or on frontend?
Can you please share problem URL and admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I checked and I found that with the Grant post type you almost have twenty-four to twentry-six taxonomies assigned and that is a lot of content and if you may test without Toolset you may experince the same.
Regarding the screenshot you shared for the slow query, the first slow query is from WordPress code and that is becuase you have too many taxonnomies and second slow query belongs to "Plugin: wordpress-seo" we can not do much here due to the structure you have.
I've seen with few taxonomies you have only three or four terms added. There is a change to improve there but that will result is change of structure. Converthing such taxonomies where you have few terms to custom field.
Ya I understand we do have lots of taxonomy and terms , we will try to reduce as much as possible. Meanwhile we constantly see this slow query
SELECT DISTINCT t.term_id, tr.object_id
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt
ON t.term_id = tt.term_id
INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy IN ('location', 'c....................................., 'horizon')
AND tr.object_id IN (274715, 217026, 220155, 217739, 277540, 277572, 218692, 293377, 43671, 293687, 292889, 292635, 293668, 293676, 293645, 250833, 194243, 293666, 102415, 286043)
ORDER BY t.name ASC
we repair and optimized the wp_terms, wp_terms_relationship and wp_term_taxonomy but still we see those slow queries , Can you please suggest what are the ways we can reduce this slow queries . Do i need to do reindexing? Can you please guide us on this.
Thanks for looking into the issue. I still see the issue in query monitor
I checked the query monitor still i see the slow query
SELECT DISTINCT t.term_id, tr.object_id
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt
ON t.term_id = tt.term_id
INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy IN ('location', '....................................., '...izon')
AND tr.object_id IN (274715, xxxxxx, 286043)
ORDER BY t.name ASC
What I tried , I tried to change the index
ALTER TABLE wp_term_relationships
DROP INDEX idx_term_taxonomy_object,
ADD INDEX idx_object_term (object_id, term_taxonomy_id);
and index the wp_terms
ALTER TABLE wp_terms
ADD INDEX idx_name (name);
But still i see the same issue , please guide me on this
This is not a Toolset issue actually. You have 23 taxonomies and even without Toolset if you query that many taxonomies with that many number of records it will have a issue.
I tried to display 15 results per page on your admin section and also try to display fewer columns on listing screen for the post type "Grant" and I can see it improved the result.
- hidden link