#39896 [Opn->Asn]: Massive memory leak
| From: | tony2001@php.net | Date: | Wed, 20 Dec 2006 10:32:28 +0000 |
| Subject: | #39896 [Opn->Asn]: Massive memory leak | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106619@lists.php.net to get a copy of this message | ||
ID: 39896
Updated by: tony2001@php.net
Reported By: poon dot fung at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: SimpleXML related
Operating System: Windows XP
PHP Version: 5.2.0
-Assigned To:
+Assigned To: helly
Previous Comments:
------------------------------------------------------------------------
[2006-12-20 10:20:42] poon dot fung at gmail dot com
Description:
------------
The combination of simplexml and htmlspecialchars() creates massive
memory leak. In a about 500k calls to htmlspecialchars() on a value in
simplexml, it eats up over 1GB of memory.
Reproduce code:
---------------
$xml = simplexml_load_file('some_xml_file.xml');
$val = '';
for ($index=0; $index<10000000; $index++)
{
$val = htmlspecialchars($xml->title);
}
Expected result:
----------------
If you run the above script and watch Windows Task Manager, you will
see memory usage continuous to go up non-stop.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39896&edit=1