Are you able to deactivate some of your other plugins one by one to see if you can get rid of that memory exhaustion? Usually this is caused when there is an exceptionally high number of database queries, translations, capability checks server side http requests, etc being performed, and the sheer amount of data being collected by QM causes the memory exhaustion. It’s a bit of a tug of war unfortunately.
Also if you can get a full stack trace for that error it might help.
Hey John
Thanks for getting back and pointing me in the right direction
Still having the same issue even with all plugin disabled, made me wonder if it’s the theme, so tried switching to another theme, and it shows up
Will try putting the theme code under a magnifying glass, but the theme I’m using a Tailwind version of _s theme from here – https://underscoretw.com/
As for the stack trace, there’s nothing really in both debug log and php-fpm-error logs
Only the code below
[26-Feb-2023 17:00:10 UTC] PHP Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Transport/cURL.php on line 345
[26-Feb-2023 17:00:12 UTC] PHP Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Transport/cURL.php on line 345
[26-Feb-2023 17:00:13 UTC] PHP Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Transport/cURL.php on line 345
[26-Feb-2023 17:00:14 UTC] PHP Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Transport/cURL.php on line 345
[26-Feb-2023 17:00:15 UTC] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 118784 bytes) in /var/www/rm-wp.srmllc.net/public/wp-includes/functions.php on line 1069
[26-Feb-2023 17:00:16 UTC] PHP Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in phar:///usr/local/bin/wp/vendor/rmccue/requests/library/Requests/Transport/cURL.php on line 345Another reload only gives the following
[26-Feb-2023 17:03:36 UTC] WP to Buffer Pro: publish(): Test Mode: No
[26-Feb-2023 17:03:38 UTC] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 118784 bytes) in /wp-includes/functions.php on line 1069
[26-Feb-2023 17:03:45 UTC] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 118784 bytes) in /wp-includes/functions.php on line 1069Disabling built in theme functions to troubleshoot
Will post what I find out here
After going through my theme code line by line, I came across this piece of code
if (!defined('RM__VERSION')) {
// Get the theme version from the style.css file.
define('RM__VERSION', function () {
$theme = wp_get_theme();
return $theme->get('Version');
});
}It is used to dynamically set the theme version for use in script and asset versioning. It appears I had somehow got carried away and defined it using a function (set it up while setting up action hooks and filters) instead of something I would normally do, i.e, set a variable for the theme version and use that in the definition instead
Here is the piece of updated code and voila, it works, QM shows up and my pages loading well under 800ms
$theme_version = $theme_version = wp_get_theme()->get('Version');
if (!defined('RM__VERSION')) {
// Get the theme version from the style.css file.
define('RM__VERSION', $theme_version);
}Now I can go back to shaving of more milliseconds and debugging those queries
Actually, I think I might just take a break first 😂
