#38604 [Fbk->Opn]: Memory leak in SimpleXML ?
| From: | apachephp at gmail dot com | Date: | Mon, 28 Aug 2006 07:30:04 +0000 |
| Subject: | #38604 [Fbk->Opn]: Memory leak in SimpleXML ? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101413@lists.php.net to get a copy of this message | ||
ID: 38604
User updated by: apachephp at gmail dot com
Reported By: apachephp at gmail dot com
-Status: Feedback
+Status: Open
Bug Type: SimpleXML related
Operating System: Linux
PHP Version: 5.1.5
New Comment:
the same problem with php5.2-200608280630
Previous Comments:
------------------------------------------------------------------------
[2006-08-28 06:16:35] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-08-26 06:51:00] apachephp at gmail dot com
Description:
------------
I'm processing big XML file (1-10MB each) in loop.
Very soon free memory is near to zero and system starts swapping.
Reproduce code:
---------------
<?
function ProcessFile($filename)
{
if (file_exists($filename)) {
$xml =
simplexml_load_string(file_get_contents($filename));
foreach ($xml->report as $reports)
{
//echo $reports->forumid."\n";
}
// var_dump($xml);
unset($xml);
} else {
exit('Failed to open test.xml.');
}
}
$files=file('files.txt');
foreach ($files as $file)
{
$file=chop($file);
echo "Processing $file\n";
ProcessFile($file);
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38604&edit=1