#38604 [Opn->Fbk]: Memory leak in SimpleXML ?

From: Date: Mon, 28 Aug 2006 08:09:06 +0000
Subject: #38604 [Opn->Fbk]: Memory leak in SimpleXML ?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-101418@lists.php.net to get a copy of this message
ID: 38604 Updated by: tony2001@php.net Reported By: apachephp at gmail dot com -Status: Open +Status: Feedback Bug Type: SimpleXML related Operating System: Linux PHP Version: 5.1.5 New Comment: I don't think you really need 10Mb file to reproduce it. If it really leaks, then it should do it even with 10 bytes XML file. Previous Comments: ------------------------------------------------------------------------ [2006-08-28 07:58:29] apachephp at gmail dot com is it OK if I upload my XML files somewhere ? ------------------------------------------------------------------------ [2006-08-28 07:56:56] tony2001@php.net Cannot reproduce. ------------------------------------------------------------------------ [2006-08-28 07:30:04] apachephp at gmail dot com the same problem with php5.2-200608280630 ------------------------------------------------------------------------ [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

« previous php.bugs (#101418) next »