> > Each time I reload my application with the Manager servlet the
> > memory usage
> > increase.
> >
> > Spec: I have Tomcat 4.0.2 and JDK 1.3.1_02 running on a Windows2k
machine.
> >
> > I have located my problem using JProbe with Tomcat 4.0.2. Looking at the
> > instance summary before and after a reload I see that there is one class
> > that isn't GC'd. So after 10 reloads I have 10 instances of this
> > class. The
> > class is a singelton and lookes something like this:
> >
> > public class MySingelton
> > {
> >     private static MySingelton singelton;
> >
>
> Above is the reference that don't let your class to be GC'ed.
> You should add something like close() to your class
>
> public void close() {
> singleton = null;
> }
> and then call it in your servlet's destroy()
>
>

So simple!! Many thanks :).
Have never had to reload applications with singelton objects before.

Thomas




--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to