php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39896 Massive memory leak
Submitted: 2006-12-20 10:20 UTC Modified: 2006-12-20 18:41 UTC
From: poon dot fung at gmail dot com Assigned: helly (profile)
Status: Not a bug Package: SimpleXML related
PHP Version: 5.2.0 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 + 36 = ?
Subscribe to this entry?

 
 [2006-12-20 10:20 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-20 18:41 UTC] iliaa@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Dupe of bug #38604
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 05:01:33 2024 UTC