This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes When will the instance of Servlet be deleted? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "When will the instance of Servlet be deleted?" Watch "When will the instance of Servlet be deleted?" New topic
Author

When will the instance of Servlet be deleted?

dylan shen
Greenhorn

Joined: Oct 20, 2001
Posts: 10
After an object of Servlet is created, it will stay in server until the server down?
Or there are some cases that the object will be deleted?
Thanks
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
Whenever the servlet container determines that a servlet should be unloaded, perhaps to reclaim some resources or because it is being shutdown, the server calls the servlets's destroy method after allowing all of the servlet's service() threads to complete ( or a server-defined time-limit) The servlet is then eligible for a GC. The servlet container is not required to keep a servlet loaded for any specific amount of time.
dylan shen
Greenhorn

Joined: Oct 20, 2001
Posts: 10
I see
Thanks for your help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When will the instance of Servlet be deleted?