Well, the servlet will get destroyed when the servelet is garbage collected
I think. The JVM has a garbage collection thread which starts up
automatically, and its its job to  cleanup unused objects. I'm not sure if
this behaviour changes in tomcat. You can explicitly call the garbage
collector by calling System.gc(),or something similar.
Note that something will only be garbage collected when nothing holds any
references to it (an  oversimplification I know). If you simply want to free
some resources up after a servlet is used, do this in your doPost/doGet
methods.

sam
----- Original Message -----
From: "H.F.N. den Boer" <[EMAIL PROTECTED]>
To: "Tomcat users group" <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 10:42 AM
Subject: Cleaning up servlets


> When a servlet is destroyed, I log a number of things.
> >From the log I conclude that servlets are only destroyed when the NT
service is
> shut down manually.
>
> Do I need to run a separate process (thread) to monitor how long a servlet
is
> not used and from that process destroy it or is there some other way to
keep my
> environment clean ? Maybe a Tomcat setting ?
>


Reply via email to