Heya,

A colleague recommended to me to do a check for and clean up any rouge dom objects at the end of the proc that was handling them. I had indeed somehow left some kicking around using up memory.

I have added:

foreach lostdom [info commands domDoc0*] {
   $lostdom delete
}

As you say though, best to make sure you catch them when your dealing with them and explicitly delete them.

Thanks
Nick

John Buckman wrote:
FYI, on the tdom leak, I found that my app (BookMooch) was leaking as well (thanks for mentioning the leak problem you're having, it helped me find mine), and the reason is that tdom NEVER automatically releases memory for the documents it creates (the docs say " the document object command has to be explicitly deleted ").

Therefore, I highly recommend adding a
$doc delete

to manually delete any tdom objects you create.

Below are the relevant docs for tdom for this.

-john



dom parse ?options? ?data?
Parses the XML information and builds up the DOM tree in memory providing a Tcl object command to this DOM document object. Example:
dom parse $xml doc
$doc documentElement root
parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and assigns this new object name to the variable doc. When doc gets freed, the DOM tree and the associated Tcl command object (document and all node objects) are freed automatically.

set document [dom parse $xml]
set root     [$document documentElement]
parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and returns this new object name, which is then stored in document. To free the underlying DOM tree and the associative Tcl object commands (document + nodes + fragment nodes) the document object command has to be explicitly deleted by:

$document delete
or
rename $document ""


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to