ballhogjoni Posted August 23, 2011 Share Posted August 23, 2011 I have a wordpress site that has this error in my error logs and seems to be causing the site to load very slow: PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 64 bytes) in /home/name/public_html/wp-includes/meta.php on line 339 this is line 339: $cache[$mpid][$mkey] = array(); a couple line above and below: if ( !empty($meta_list) ) { foreach ( $meta_list as $metarow) { $mpid = intval($metarow[$column]); $mkey = $metarow['meta_key']; $mval = $metarow['meta_value']; // Force subkeys to be array type: if ( !isset($cache[$mpid]) || !is_array($cache[$mpid]) ) $cache[$mpid] = array(); if ( !isset($cache[$mpid][$mkey]) || !is_array($cache[$mpid][$mkey]) ) $cache[$mpid][$mkey] = array(); // Add a value to the current pid/key: $cache[$mpid][$mkey][] = $mval; } } Can some please help this is causing major issues. Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/ Share on other sites More sharing options...
btherl Posted August 23, 2011 Share Posted August 23, 2011 It says it's running out of memory. How many items do you have in $meta_list? And how many meta lists would you process in one run of the script? The memory usage may also be elsewhere - it could fail here because memory was filled up elsewhere in the script. It looks like your memory limit is 64 megabytes. Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/#findComment-1260803 Share on other sites More sharing options...
voip03 Posted August 23, 2011 Share Posted August 23, 2011 Try a mysql_unbuffered_query() rather than mysql_query(). Your query is probably returning too much data as is for your php server to handle Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/#findComment-1260851 Share on other sites More sharing options...
ballhogjoni Posted August 23, 2011 Author Share Posted August 23, 2011 It says it's running out of memory. How many items do you have in $meta_list? And how many meta lists would you process in one run of the script? The memory usage may also be elsewhere - it could fail here because memory was filled up elsewhere in the script. It looks like your memory limit is 64 megabytes. These are all very good questions, this is wordpress, i didn't write the code so I don't really know the answer unless I annoy my users with echoing out errors. That being said should I just raise the memory limit or is that just a band-aid? Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/#findComment-1260928 Share on other sites More sharing options...
ballhogjoni Posted August 23, 2011 Author Share Posted August 23, 2011 I echoed out the table being used in the query and I get three table, or atleast the ones i saw on the page. when I go to a post i see these tables being used: wp_commentmeta, wp_postmeta, wp_usermeta They seem to be used quite a bit because I see them all over the page. FYI the size of the tables: wp_commentmeta = 134.3 MiB, wp_postmeta = 8.7 MiB, wp_usermeta = 72.5 KiB Also all the tables in my db are myisam, should I change them to innodb? Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/#findComment-1260932 Share on other sites More sharing options...
QuickOldCar Posted August 23, 2011 Share Posted August 23, 2011 FULLTEXT indexes are not supported by innodb, if any plugin relied on using this you would have issues. I doubt that's your problem, something is producing too much data for your allowed memory settings. Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/#findComment-1260940 Share on other sites More sharing options...
ballhogjoni Posted August 23, 2011 Author Share Posted August 23, 2011 I looked into mysql_unbuffered_query, can't find a way to integrate that into the script without modifying the wordpress database class. don't really want to do that, because if wordpress pushes an update, then my changes could be overwritten. Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/#findComment-1260941 Share on other sites More sharing options...
ballhogjoni Posted August 23, 2011 Author Share Posted August 23, 2011 more looking into it, i was looking at one of my sitemaps and it produced the following output: Fatal Error (hide) The theme has encountered a problem that it cannot recover from. Please use the following information to try to resolve the problem. Error Code: php_code_error:1:/home/name/public_html/wp-content/plugins/w3-total-cache/lib/W3/Cache/Memcached.php:75:Allowed memory size of 67108864 bytes exhausted (tried to allocate 44 bytes) Message: A fatal code error occurred. If you are unable to fix this problem, please copy all the text on this screen and send it to support@ithemes.com. Debug Data: Array ( [0] => Array ( [file] => /home/name/public_html/wp-content/plugins/tabber-widget/lib/classes/it-error.php [line] => 123 [function] => fatal [class] => ITError [type] => :: [args] => Array ( [0] => php_code_error:1:/home/name/public_html/wp-content/plugins/w3-total-cache/lib/W3/Cache/Memcached.php:75:Allowed memory size of 67108864 bytes exhausted (tried to allocate 44 bytes) [1] => A fatal code error occurred. ) ) [1] => Array ( [file] => /home/name/public_html/wp-content/plugins/tabber-widget/lib/classes/it-error.php [line] => 150 [function] => handle_error [class] => ITError [type] => :: [args] => Array ( [0] => 1 [1] => Allowed memory size of 67108864 bytes exhausted (tried to allocate 44 bytes) [2] => /home/name/public_html/wp-content/plugins/w3-total-cache/lib/W3/Cache/Memcached.php [3] => 75 ) ) [2] => Array ( [function] => it_error_shutdown [args] => Array ( ) ) ) so now I don't know if its w3 total cache, tabber widget, or memcached what pisses me off is that i changed the php.ini file to accept 256M for memory limit. Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/#findComment-1261013 Share on other sites More sharing options...
btherl Posted August 23, 2011 Share Posted August 23, 2011 If you can increase memory then I would try it. That last message you posted shows the 64M limit again, so the change may not have taken effect. Googling for "wordpress memory issues" shows several discussions that might have some good ideas. The reason I'm not recommending trying to diagnose the problem is because you're using a third party package (wordpress), and it's generally easier to increase memory than to try to analyze such a large system, as long as you have enough memory available. Quote Link to comment https://forums.phpfreaks.com/topic/245476-php-fatal-error-allowed-memory-size-of-67108864-bytes-exhausted/#findComment-1261106 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.