On Friday 25 February 2005 18:22, Andrew Piskorski wrote: > On Fri, Feb 25, 2005 at 11:30:13AM -0500, Dossy Shiobara wrote: > > > So, we DO clean up channels, and Tcl global variables in the top-level > > ("::") namespace, but not namespace variables -- those tend to be used > > differently than Tcl globals, so they generally DO need to persist > > between connections within an interp. > > Why? Why would ever you want namespace vars to persist in the Tcl > interp for that one particular thread? As opposed to merely > tolerating such persistence? > > > Yes, if you want to enforce full clean-up by dumping the Tcl interp > > after processing each request, you could set connsperthread == 1, > > but then you'd lose the > > Yuck. Tcl interps are often (maybe always?) FAR from light weight, so > destroying and re-creating them constantly simply in order to re-set a > bit of state seems like massive overkill. > > When AOLserver initializes a new thread, how much of that time is > spent in setting up the Tcl interp (and all its procs)? Am I correct > in assuming that it is the vast majority? > >
What Dossy is rightly saying is: you wouldn't want to drop Tcl interp for each conn. This is correct and this is how AS is doing things already. The issue here is a "leak" of Tcl commands, namespaces, vars etc, left in the interp after the connection processing. This is *not* easy to handle. Therefore nobody really tackled this issue. So, you do the best you can: leave the interp until the conn *thread* goes down the drain, which will eventually never happen and hence you have de-facto leaks(s). Or invent a ns_cleanup thing which does *part* of the job. So, this issue is about those resource "leaks". Not the real memory leaks you would track with Purify or such. Rather the "resource" leaks; things created but never destroyed. tdom is not different than any Tcl extension. It will create "things" for you and you should be responsible for destroying "things" when not needed any more. Now, the life would be easier with kindof [tdom cleanup] because it would do the right thing for you with one shot. I agree with Dossy on this point. But, thinking about this again... [tdom cleanup] would be nice and short, yet pretty inflexible. I'd rather make something like introspection in form of: dom documents dom commands or such which will report all resources generated by tdom package. Then you could decide what you'd like to do with them. Some similar to [file channels] from Tcl. Zoran -- With kind regards, Mit besten Gruessen, Meilleures Salutations, ___________________________________________ Zoran Vasiljevic, Vice President, CTO E-mail: mailto:[EMAIL PROTECTED] Web: http://www.archiware.com Phone: +49 89 319 084 98 Fax: +49 89 319 084 99 S-mail: ArchiWare(R) GmbH Gutenbergstr. 3 D-85716 Munich, Germany ___________________________________________ PresSTORE(R) - Backup Synchronize Archive -- 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.