Hi Joel,

Joel Carranza <jec@gatekeeper.com> wrote on 02/17/2010 05:57:50 PM:

> We are using Batik in a webapp context and the thread
> org.apache.batik.util.CleanerThread never terminates.

    Correct, it is a daemon thread.  My understanding is
that this signals the JVM that it can terminate it if
there is nothing else of interest in it's context.

> This is a serious problem as it prevents the webapp's classloader
> from being garbage collected.

   Why is that a particularly serious problem?  It seems to
me that generally speaking the classloader isn't GCed unless
the JVM goes away anyway.

> Am I doing something wrong?  Is there a way to "clean up" and
> stop this thread when my webapp exits?

   Batik doesn't provide one currently.  It's a little
tricky since you shouldn't kill that thread until all objects that
have been registered with the associated ReferenceQueue have been

   You might be able to do something with TheadGroups and 'stop'.
You could also register a PhantomWeakReference and have it's
'cleared()' method throw a ThreadDeath exception.

   You also have access to the source and contributions are always
welcome ;)