No, imagine if you used a thread to say send an email.
The webapp is done, tomcat is idling and it whacks your thread that hasnt
done the email yet.
You see it in normal java apps as well, ie if a thread is still busy and you
close the app, if you look at the processes, the thread is keeping it alive.
You have to signal your thread, so perhaps when the class that started the
threads is destroyed, it sets a variable that the threads can see, and they
start shutting down.
The idea is to rather give them a chance to stop themselves. If you simply
destroy, the state of whatever they where doing, it could be a mess.... I
mean imagine if one of those threads was backup your dB.... its half way...
how do you stop it?
You certainly dont want Tomcat to just whack it.....
Have fun....
----- Original Message -----
From: "David Delbecq" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Wednesday, June 06, 2007 4:55 PM
Subject: webappclassloader won't get garbage colelcte, need suggestions (out
of memory)
Hello,
Trying to locate memory leak issues (not garbage collected classes &
classloader) i noticed this huge problem:
My webapp uses libraries that spawn helper Threads, using the default
ThreadGroup. Those Helper Thread are subclasses of java.lang.Thread that
override the run(). After stopping properly all those Threads at webapp
shutdown (they have all existed from run() ), it seems those Threads are
still referenced by the main ThreadGroup. Shouldn't tomcat clean the
ThreadGroup when a webapp is undeployed? This indirect directional link
between a system ThreadGroup and WebappClassLoader loader classes
prevents garbage collecting.
Am currently working on a context listener in my webapp that will clean
it at destroy time, but am pretty sure this should be the container's job.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]