Re: Memory issues after PHP 5.5 upgrade

Nick Wellnhofer <[email protected]> Sat, 18 Apr 2015 15:26:22 +0200
Newsgroups gmane.comp.gnome.lib.xslt
Message-ID <[email protected]>
On 18/04/2015 00:14, Lance Hutcheson wrote:
> I have inherited an PHP application that makes extensive use of XML and XSLT.
> After upgrading PHP from 5.4.xx to 5.5.23, the memory usage of transformations
> using XSLTProcessor::transformToDoc have gone through the roof.
>
> I have debugged the PHP and XSL as much as I can even though nothing in the
> code itself changed - just upgraded PHP.
>
> In an example transformation involving an XML file that is 2.9MB in size, the
> PHP/Apache process prior to the transformToDoc call shows 390MB of memory
> usage and immediately following the transformToDoc call, the process shows to
> be consuming 2.4GB of memory.  (The PHP function memory_get_usage() returns
> 6461888, so PHP doesn't hit its memory_limit.)
>
> I don't have any hard numbers from the PHP 5.4 setup, but there were no memory
> spikes like this.  With larger XML documents, we are seeing a single Apache
> process consume 50+GB of memory.

This looks more like a PHP issue to me. Maybe you should try to post it on a 
PHP list or bug tracker first.

If you think this issue is related to libxslt and not PHP, please provide a 
minimal, reproducible example. Also tell us which libxslt and libxml2 version 
your PHP 5.4 and 5.5 installations use.

Nick