Jump to content

PHP Fatal error: Allowed memory size of 67108864 bytes exhausted


ballhogjoni

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.