ID: 24015
User updated by: rbro at hotmail dot com
Reported By: rbro at hotmail dot com
Status: Bogus
Bug Type: DOM XML related
Operating System: RedHat 7.3
PHP Version: 4.3.2
New Comment:
Thanks for your reply - How do I free() the xpath object in the middle
of my loop? I don't believe there is a xpath->free() function.
Previous Comments:
------------------------------------------------------------------------
[2003-06-04 10:30:04] [EMAIL PROTECTED]
As illustrated in your example, without the xpath context usage, memory
uage remains constant. DomDocument->free will just free the document in
memory. The memory increase you see is coming from the xpath objects
you keep creating.
------------------------------------------------------------------------
[2003-06-04 09:12:11] rbro at hotmail dot com
While the following script is running, the RAM usage increases greatly
when it should just remain relatively constant because free() is being
used. Upon further investigation, if I comment out the $xpath line,
the RAM usage remains constant, so it's something with creating/using a
xpath object and then trying to free the entire domxml object later.
<?php
$xml = '<root><a></a></root>';
for ($i = 1; $i <= 50000; $i++)
{
$dom = domxml_open_mem($xml);
$xpath = xpath_new_context($dom);
$dom->free();
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24015&edit=1