On Friday 25 February 2005 15:28, Dossy Shiobara wrote:
> On 2005.02.25, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote:
> >
> > All procs are dumped by Tcl interpreter being dumped when the
> > connection thread exits.
>
> This is not true, unless you set connsperthread != 0, which we've
> recently discovered also has a big memory leak issue which I'm still
> tracking down. 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.
You're saying that the Tcl interp still lives when a connection
thread exits? This is not true. When the connection thread exits,
the associated interp (if any) is dumped.
What you rather mean is: when the *connection* exits (closes).
This is something entirely different...
If you, with every page, create new Tcl commands, yes, they will
stay in memory (interp) and never get garbage collected until this
interp is dumped. But if the connection thread is sticky, then
this will not happen, of course. I wouldn't call this a leak, though.
This is true for any other Tcl resource: channels, namespaced
variables, namespaced procedures etc... The AS garbage-collection
mechanism on those things is poor and incomplete (admit: problem
is not easy to solve w/o programmer involvement).
Hence: this is not a tdom leak. This is the AS garbage-collector
issue and cannot be workaround'ed by the tdom implementation.
> 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.
Well, admit, this fact should be stated more clearly in the docs.
> Well, I was expecting this:
>
> $ tclsh
> % proc foo {} {}
> % foo
> % rename foo {}
> % foo
> invalid command name "foo"
>
> I wasn't expecting this:
>
> self-referential recursion in "unknown" for command "foo"
>
> Is this not a bug? Why can I not safely "delete" new tDOM-created procs
> by renaming them to the empty string like I can with ordinary Tcl procs?
lexxsrv:nscp 7> dom createNodeCmd elementNode junk
::junk
lexxsrv:nscp 8> junk
called outside domNode context
lexxsrv:nscp 9> rename junk ""
lexxsrv:nscp 10> junk
invalid command name "junk"
Where is the problem?
> I actually didn't want to. I just wanted to be able to use the
> "appendFromScript" feature of tDOM but my document has a node called
> "<string>" so I had to do:
>
> $doc createNodeCmd elementNode string
>
> I did NOT want it to clobber the Tcl ::string proc. Because of this,
> I could NOT use the createNodeCmd/appendFromString. I *could* have
> worked around it with something like this, I suppose:
Is this what you're looking for:
lexxsrv:nscp 12> namespace eval junk {dom createNodeCmd elementNode string}
::junk::string
lexxsrv:nscp 13> string
wrong # args: should be "string option arg ?arg ...?"
lexxsrv:nscp 14> ::junk::string
called outside domNode context
Or, is it something else I'm missing here?
--
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.