Joel Carranza <email@example.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
that this signals the JVM that it can terminate it
there is nothing else of interest in it's context.
> This is a serious problem as it prevents the
> from being garbage collected.
Why is that a particularly serious problem?
It seems to
me that generally speaking the classloader isn't GCed
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
You might be able to do something with
TheadGroups and 'stop'.
You could also register a PhantomWeakReference and
'cleared()' method throw a ThreadDeath exception.
You also have access to the source and
contributions are always