Tomcat JSP session beans not being removed at the end of the session

J

John Smith

I am using Tomcat 4.0. I have a number of JSP beans with scope="session".
The beans a simple and do not contain any circular references. When a
session times out I have noticed the beans are not cleaned up. I have
checked this by adding a finalize to the classes and this does not indicate
them being removed.

Any ideas?

Thanks Jon
 
W

William Brogden

I am using Tomcat 4.0. I have a number of JSP beans with scope="session".
The beans a simple and do not contain any circular references. When a
session times out I have noticed the beans are not cleaned up. I have
checked this by adding a finalize to the classes and this does not
indicate
them being removed.

Are you sure that GC has been run? Invalidating a session just
removes the reference, your finalize won't show up until GC runs.
Bill
 
S

Sampsa Sohlman

John said:
I am using Tomcat 4.0. I have a number of JSP beans with scope="session".
The beans a simple and do not contain any circular references. When a
session times out I have noticed the beans are not cleaned up. I have
checked this by adding a finalize to the classes and this does not indicate
them being removed.

Any ideas?

Thanks Jon

Tomcat is made with java and like all java applications memory is freed
by garbage collector and finalize method is called when gc is going to
free object from memory. If you need information about when session is
dying use javax.servlet.http.HttpSessionListener interface.

- Sampsa

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top