destructor in domxml not freeing all memory, any clues?
| From: | Christian Stocker | Date: | Wed, 28 Aug 2002 15:28:16 +0000 |
| Subject: | destructor in domxml not freeing all memory, any clues? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-87570@lists.php.net to get a copy of this message | ||
Hi
I just watched my apache and simply doing
domxml_new_doc("1.0");
eats memory on the httpd process, which is not released after script end.
not much, but constantly...
the destructor code for a DomDocument Object looks the following:
****
static void php_free_xml_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
xmlDoc *doc = (xmlDoc *) rsrc->ptr;
if (doc) {
node_list_wrapper_dtor(doc->children);
node_wrapper_dtor((xmlNodePtr) doc);
xmlFreeDoc(doc);
}
}
****
there are no children, so node_list_wrapper_dtor does nothing here.
node_wrapper_dtor is (shortened to the relevant stuff):
*****
static inline void node_wrapper_dtor(xmlNodePtr node)
{
zval *wrapper;
wrapper = dom_object_get_data(node);
if (wrapper != NULL ) {
zval_ptr_dtor(&wrapper);
}
}
*****
Anyone any idea, what I have to release additionally to avoid this "memory
leak"? I'm not (yet) that much of an expert in ZE :)
TIA
chregu
--
christian stocker | bitflux GmbH | schöneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid
0x5CE1DECB