[pmwiki-users] Compat1x, enormous pages, and memory limits

Patrick R. Michaud pmichaud at pobox.com
Tue Oct 3 23:16:50 CDT 2006


On Wed, Oct 04, 2006 at 12:18:12PM +1300, Donald Gordon wrote:
> Hi
> 
> I'm trying to convert a PmWiki v1 wiki to a v2 wiki using compat1x.php,
> but have run into a snag.  Enormous pages cause PHP to run out of
> memory when converting the markup.
> 
> My quick fix, to replace the single call to preg_replace in
> compat1x.php with a loop, seems to greatly help matters.  The
> PageStore1x class with this change added is shown below:
> [...]
> As far as I can tell, when performing a preg_replace on arrays, PHP4
> does no memory reclaimation.  With this change (and the disabling of
> one large extension), our out of memory errors go away.
> 
> Any chance of this change getting into the release?

Absolutely!  

And given this information, I'll also be converting any other
places where preg_replace is being called with arrays.

Many thanks,

Pm




More information about the pmwiki-users mailing list