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:
script: <?php $XML='<TAG1> <TAG2> <TAG3>6809586b1c38100f</TAG3> <TAG4>4323ac020</TAG4> <TAG5>NULL</TAG5> <TAG6>4323ac04e</TAG6> <TAG7>ihttp://www.mysqlperformanceblog.com/</TAG7> <TAG8>Who AM I</TAG8> <TAG9>00000232343d3062</TAG9> <TAG10>204923</TAG10> <TAG11>http://www.mysqlperformanceblog.com/</TAG11> <TAG12>http://www.mysqlperformanceblog.com/</TAG12> <TAG13 date="2006-08-22 11:44:00"> <TAG14></TAG14> <TAG15>Apachephp </TAG15> <TAG16> Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. </TAG16> <TAG17></TAG17> <TAG18></TAG18> <TAG19>0</TAG19> <TAG20></TAG20> </TAG13> <TAG21></TAG21> <TAG22></TAG22> <TAG23>2006-08-22 23:19:43</TAG23> <TAG24>Qwerrt</TAG24> <TAG25>1</TAG25> <TAG26>http://www.mysqlperformanceblog.com/</TAG26> <TAG27>http://www.mysqlperformanceblog.com/</TAG27> <TAG28>1</TAG28> <TAG29>918180</TAG29> <TAG30> MySQL Performance tuning optimization consulting</TAG30> <TAG31></TAG31> <TAG32>Simple XML </TAG32> <TAG33>0</TAG33> <TAG34>0</TAG34> <TAG35>1</TAG35> <TAG35></TAG35> <TAG36></TAG36> </TAG2> </TAG1>'; function ProcessFile($filename) { global $XML; $xml = simplexml_load_string($XML); echo "Memory: ".memory_get_usage() . "\n"; foreach ($xml->report as $reports) { //echo $reports->forumid."\n"; } // var_dump($xml); unset($xml); } while(true) { ProcessFile($file); echo "Loop ".($i++).", memory used: ".memory_get_usage() . "\n"; } ?> output: Loop 1, memory used: 57844 ... Loop 1000, memory used: 269632 .. Loop 5000, memory used: 1461740 .. Loop 10000, memory used: 2914996 Loop 65531, memory used: 17047104 Memory: 17047104 Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 3145728 bytes) in /mnt/data/home/vadim/testfeed/testxml2.php on line 57 Previous Comments: ------------------------------------------------------------------------ [2006-08-28 08:49:54] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2006-08-28 08:46:08] apachephp at gmail dot com Well, I don't have XML files with 10 bytes, and with 10Mb files my memory is exhausted after processing 20 files. Memory is OK if I am processing files one per run. ------------------------------------------------------------------------ [2006-08-28 08:09:05] [EMAIL PROTECTED] 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. ------------------------------------------------------------------------ [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] [EMAIL PROTECTED] Cannot reproduce. ------------------------------------------------------------------------ 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 http://bugs.php.net/38604 -- Edit this bug report at http://bugs.php.net/?id=38604&edit=1