Hi Rynan,

"Ryan.Wilson" <[EMAIL PROTECTED]> wrote on 09/22/2008 05:51:51 
PM:

> It occurs when someone changes the page they are looking at without 
closing
> the browser. If they close the browser, the jvm that is attached to the
> browser closes with the browser. 

   Sure,

> But if they just change the page they're looking at, any leaks in the 
> applet pollute memory. If someone were to go back and forth to the 
> leaking applet, the heap eventually overflows.

    This I disagree with.  I would consider it a bug in the applet 
container if it let's anything from one run of an applet pollute the
heap.  Why/how can an applet keep anything around, all the roots for
the Applet should be cleared by the container which means that all
objects should be available for garbage collection.
 
> One possible problem that I noticed today is that a thread labelled 
"Batik
> CleanerThread" is throwing a ThreadDeath exception when the applet 
closes.
> I'm thinking that waiting for this thread to close on it's own or for it 
to
> send a "I'm Done" signal before allowing destroy to finish could either
> solve or improve my situation. 

   Anything is possible but my guess is that the problem is in the
Swing hierarchy. As long as that thread dies then it's references should 
be cleared and anything it was referencing should become available for
GC.  Of course if you have looked at that class you will see that it
doesn't ever normally exit, and it's not clear how it would know if it
was 'acceptable' to exit.

> I'm still something of a java novice and would appreciate advice on how 
I
> would go about doing this. The API docs for the CleanerThread are not 
all
> that clear.

   That class is used to notify other objects that their soft reference
is gone so they can do things like remove themselves from caches and the
like.  I'm sure that this sounds like something that would cause your
problem but in the case of closing the Applet the objects holding the
SoftReferences should also become available for GC so it shouldn't
cause any memory leaks.

   In our memory leak test it was hard to convince swing to really
release all of it's references to our canvas.

Reply via email to