|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-10-30 04:44 UTC] jury at elkor dot lv
DOMXML Not free created document and php as static binary using as much memory as can. After usage of all memory kernel kill process
I'v not found any php_functions which is freeing XML Document. Except unset()
Example:
<?
while(1)
{
$xml_doc = domxml_new_xmldoc("1.0");
unset($xml_doc)
}
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 05:00:01 2025 UTC |
Hi chregu, I see a couple of months ago you added a $dom->free() method. I'm running into the exact same problem except with a xpath object such as: <?php $xml = '<root><a></a></root>'; for ($i = 1; $i <= 50000; $i++) { $dom = domxml_open_mem($xml); $xpath = xpath_new_context($dom); $dom->free(); } ?> I added a bug about this in bug 24015 but it was marked as not a bug. The xpath objects end up using up all my RAM (512 MB) and all my virtual memory because there is no way to free() the xpath object in the middle of the execution. Would you be able to add a $xpath->free() function that's analogous to $dom->free()? I currently have a CLI script trying to process several thousand different xml streams where I'm running into these memory problems. Thanks.