On Thu, 12 Oct 2000, Daniel Wickstrom wrote:
> >>>>> "Mo" == Mo DeJong <[EMAIL PROTECTED]> writes:
>
>
> Mo> That does seem logical. It looks like the Class refs need to
> Mo> be cleaned up. What do you think of the patch below?
>
> The patch looks good. I'll have to wait until tonight to apply it, as
> I can't seem to apply it to the version that I have available right now.
>
> Mo> This would tend to happen if you created a lot of Tcl or Java
> Mo> threads and loaded Tcl Blend into them. Is that what you are
> Mo> doing? This also sounds like that mem leak problem from
> Mo> yesterday, do this patch help? The patch is for the
> Mo> ajuba-tclblend-contract-2000-08-01-branch branch in the CVS.
>
> Exactly. Each time someone accesses a url a new thread is spawned for
> the connection and tlcblend is loaded into it. In the test case that
> I ran, there were probably more than 20 concurrent threads with
> tclblend loaded into each of them.
Well, that would do it :)
> Mo> That seems to happen to me too.
>
> Are you saying that you also don't see the cleanup cache method get called
> at the end of a thread? If not, this would indicate a problem with
> the tcl implementation not calling these registered cleanup procs.
Yup.
> Mo> It seems like the new cache
> Mo> cleanup method is getting called when Tcl Blend is loaded into
> Mo> Tcl, but I am not sure what is going on when you load Tcl
> Mo> Blend and Tcl into a JVM. How could we test this sort of
> Mo> thing?
>
> I'm not sure what your saying here, and it's probably because I'm used
> to thinking about this stuff in terms of the way it operates in
> conjunction with aolserver. In aolserver there is only one case:
There are two cleanup cases.
TclThreadCleanup is called when a Tcl thread (one that was not started
inside a JVM) is terminated. TclThreadCleanup will just call
DetachCurrentThread() to disconnect the Tcl thread from the JVM.
JavaCacheCleanup should be called when a Java or Tcl thread is
terminated, its job is to clean up the thread local cache or
classes.
I am not sure which of these you are using because the
description below says "Connection thread starts" and
then "jvm attach to the current connection thread", that
would make me think it is a thread created from Tcl.
> 1) Connection thread starts.
> 2) A new tcl interpreter is allocated to the connection thread.
> 3) jvm attach to the current connection thread.
> 4) tclblend is initialized for the current connection thread.
> 4) run tcl scripts with tclblend calls.
> 5) thread completes.
> 6) cleanup thread function is called. <-- this doesn't happen with
> aolserver
The problem I was seeing is that JavaCacheCleanup was
getting called when I exited Tcl thread but when the JVM
exited, I saw no such callback. This might be because the
finalizer was not called on exit. I need to fix that problem
with the Notifier before I can really test this properly.
Mo DeJong
Red Hat Inc
----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com