WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8594 closed defect (bug) (invalid)

Running out of memory when delete an article ...

Reported by: ixiter Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:

Description

.. and throws an error in line wp-includes/class.snoopy.php on line 894.
There are several problems. It tries to allocate $this->maxlength bytes for a file to read. maxlength is set to 500.000 - as good as any other "guessed" value. What if the filesize is higher? Usually the filesize is lower. So I patched line 894 and replaced it with:

// $_data = fread($fp, $this->maxlength);
$_data = '';
while(!feof($fp)){
	$_data .= fread($fp, 10240);
}

This might be slower. But we can ignore this, since it prevents us from running out of memory in low max_memory PHP environments. Less than or equal to 24MB.
I have no idea what the other 23,5 MB were used for by WP, when I recognized this error?!

Change History (8)

comment:1 ryan5 years ago

2.7 doesn't use snoopy for anything. Do you have a plugin that's using it?

comment:2 in reply to: ↑ description ; follow-up: vladimir_kolesnikov5 years ago

Replying to ixiter:

I suppose you are using google-sitemap-generator plugin?

comment:3 in reply to: ↑ 2 ; follow-ups: ixiter5 years ago

Replying to vladimir_kolesnikov:

Replying to ixiter:

I suppose you are using google-sitemap-generator plugin?

Yes, using that.
Plus I found out, it happens with the german WP version only. Also other probs when switch language to german.

comment:4 in reply to: ↑ 3 ixiter5 years ago

Replying to ixiter:

Replying to vladimir_kolesnikov:

Replying to ixiter:

I suppose you are using google-sitemap-generator plugin?

Yes, using that.
Plus I found out, it happens with the german WP version only. Also other probs when switch language to german.

Oh .. and it happened when I tried to delete an unpublished (never published!) article.

comment:5 in reply to: ↑ 3 vladimir_kolesnikov5 years ago

Replying to ixiter:

Please try to disable the plugin and try again. Google Sitemap Generator is very hungry for memory.

I didn't look in-depth into the plugin but it seems like it rebuilds the sitemap in case an article is posted or deleted.

comment:6 ixiter5 years ago

Ty for the hintg with Google Sitemap Generator. Indeed it was it. Reason enough to me, to write an own Google Sitemapper. Basic functions only, but not that memory problem anymore.
Give it a try -> Simple Google Sitemnap Plugin at http://suche.pytalhost.de/2008/12/13/wordpress-plugin-simple-google-sitemap-v10/

comment:7 ixiter5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

I set this ticket to 'resolve as: invalid' since it isnt really a bug in WP. It depends only on the server's PHP memory_limit and memory usage of installed plugins. So here is nothing to fix in WP.
I hope 'resolve as: invalid' is a propper status for this ticket then.

comment:8 johnbillion5 years ago

  • Milestone 2.7.1 deleted
Note: See TracTickets for help on using tickets.