On Fri, Feb 25, 2005 at 09:28:20AM -0500, Dossy Shiobara wrote:

> But, under normal operation (where connsperthread == 0), only the
> global variables get dumped when the conn thread exits.  Tcl procs
> stay behind, which is why tDOM documents (which create Tcl procs)
> linger and "leak" memory if they're not explicitly deleted.

Hm.  Does tdom keep any sort of track of what procs it has created?
If so, then at the end of each connection we just need to iterate over
that list of procs and free them all, much as for database handles.

> Perhaps what I meant was to illustrate the fact that tDOM can indeed
> clobber Tcl procs, any Tcl proc.  It doesn't create these commands in a
> ::dom sub-namespace or somewhere safe -- this is just important to know.
> It surprised me; maybe it's surprised other people, or will surprise
> other people in the future.

I haven't used tDOM at all, but let me see if I understand this: tDOM
is at least semi-implicitly creating Tcl procs for the user, but it
stuffs them into the global namespace rather than a tDOM namespace?
Why, is there some good reason for that?  What do the tDOM maintainers
have to say abou this?

Moving all tDOM auto-created procs into their own namespace would also
make solving the memory leak problem above easier, no?  Just remove
everything in that namespace when the conn ends.

--
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/


--
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