-
1. Re: debug a servlet
jonlee Aug 28, 2003 7:47 PM (in response to zohar)I'm not sure how you would debug with IntelliJ so someone else would need to step in for that one.
A servlet instance does not disappear when a request is complete. Usually it (the servlet object) is cached in memory until the next request for the servlet arrives. This enables better response, rather than creating a new servlet every time a request arrives. So only local objects in the servlet methods can be relied upon to be destroyed after use.
Sessions and their associated objects exist and are also not destroyed until a session expires. Sessions track a user and allow "state variables" to persist between pages. If you have a long expiry time for sessions or no expiry time for sessions, this will implement a memory leak in that no memory used by a session will be reclaimed. Typically, a session is configured by default for 30 minutes.
Perhaps more detail on the problem you have might help folks here. -
2. Re: debug a servlet
zohar Aug 30, 2003 11:49 PM (in response to zohar)first of all - thanks.
second - where can i read more about how a servlet behaves?
third - where can i see to what value the session expiration is set? how can I cahnge it? -
3. Re: debug a servlet
jonlee Aug 31, 2003 3:22 AM (in response to zohar)The servlet specs are available from Sun.
http://java.sun.com/j2ee/
Some simple tutorials that have the essentials are:
http://java.rrzn.uni-hannover.de/jug/servlets/tutorial/servlet_tutorial.html#lifecycle
http://www.acknowledge.co.uk/java/tutorial/servlet_tutorial/servlets/index.html
Otherwise there are plenty of books on developing servlets and they cover the lifecycle.
The SAR for your embedded servlet container will have the default session timeout configuration within the global deployment definitions. The definitions will be either in web.xml or webdefault.xml, depending on whether you are using Tomcat or Jetty, respectively. http://jakarta.apache.org/tomcat or http://jetty.mortbay.org for information on the configuration information contained in these.