Bug #70078 [Opn->Csd]: Memleak when calling PHP functions from XSL with nodes as parameter

From: Date: Thu, 30 Jan 2020 12:08:23 +0000
Subject: Bug #70078 [Opn->Csd]: Memleak when calling PHP functions from XSL with nodes as parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225251@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70078&edit=1 ID: 70078 Updated by: cmb@php.net Reported by: not-implemented at mark-plomer dot de Summary: Memleak when calling PHP functions from XSL with nodes as parameter -Status: Open +Status: Closed Type: Bug Package: XSLT related Operating System: any PHP Version: 7.3.11 Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=8226e704e4e6066a5bd41b57b2934a3371896be2 Log: Fix #70078: XSL callbacks with nodes as parameter leak memory Previous Comments: ------------------------------------------------------------------------ [2020-01-29 17:26:35] cmb@php.net The following pull request has been associated: Patch Name: Fix #70078: XSL callbacks with nodes as parameter leak memory On GitHub: https://github.com/php/php-src/pull/5130 Patch: https://github.com/php/php-src/pull/5130.patch ------------------------------------------------------------------------ [2020-01-27 22:11:44] not-implemented at mark-plomer dot de Problem still present in 7.3.11 ------------------------------------------------------------------------ [2015-09-10 08:23:49] mike@php.net Maybe Rob can have a look at it, as we're lost with these ext/libxml internals... ------------------------------------------------------------------------ [2015-09-09 18:40:16] mplomer at gmx dot de Oh, I see, my report was not clear enough: The memory is not freed, even after processing the request - I re-tested the snippet under Apache (mod_php) / Linux now. (I had to reduce the dummy XML size by factor 10, otherwise the process just crashed - memory_limit also does not apply here). AFTER the request is complete I see a memory usage (RSS) of ~ 350 MB: root 28237 0.0 0.0 421800 112 ? Ss Sep07 0:06 /usr/sbin/apache2 -k start www-data 17175 0.0 4.8 510936 24328 ? S 06:25 0:11 \_ /usr/sbin/apache2 -k start www-data 18672 0.0 69.7 911320 353168 ? S 09:10 0:10 \_ /usr/sbin/apache2 -k start ........... You are right, this still _may_ not be a "real" memleak ... but anyway, I think the recursive clone on the complete DOM node on every function call is wrong - for performance reasons - even if it gets fixed by freeing the clone immediately after the function call. ------------------------------------------------------------------------ [2015-09-09 17:58:50] cmb@php.net To clarify: there may not really be a memory *leak*, but at least the intermediate memory consumption is enormous: > Until 5.4.23 you have ~25 MB RAM usage of the process at the end > Starting with 5.4.24 you have ~1030 MB RAM usage of the process > at the end ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=70078 -- Edit this bug report at https://bugs.php.net/bug.php?id=70078&edit=1

« previous php.bugs (#225251) next »