#20168 [Com]: DOMXML - Memory Allocation Without Destroy
| From: | rbro at hotmail dot com | Date: | Wed, 04 Jun 2003 18:01:21 +0000 |
| Subject: | #20168 [Com]: DOMXML - Memory Allocation Without Destroy | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-41167@lists.php.net to get a copy of this message | ||
ID: 20168
Comment by: rbro at hotmail dot com
Reported By: jury at elkor dot lv
Status: Closed
Bug Type: DOM XML related
Operating System: LINUX May be others
PHP Version: 4.2.3
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2003-04-08 13:29:41] chregu@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2002-10-30 07:11:30] chregu@php.net
There is no $dom->free() method at the moment. The DomObjects are only
free at script-end.
Programming such a method is on the todo list...
chregu
------------------------------------------------------------------------
[2002-10-30 04:44:43] 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)
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20168&edit=1