Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How Remove Servlets From Server Memory  RSS feed

 
Abdul Kader
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I like to know how we can unload the Servlets from the server memory when they are not needed. For Example we have 1000 Servlets running in a Prod machine. Most of them are not used, how we can remove the Servlets from the Server memory...

Is there any options provided by the Server like websphere or Tomcat....
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16026
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the purposes of the servlet container is to manage the life cycle of servlets for you, so that you don't have to worry about it.

If you have not encountered a problem in practice on your server, there is no need to do difficult things in your application to try to manage the servlet container's resources manually.
[ May 12, 2008: Message edited by: Jesper Young ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can see if there is anything provided in the management console for your container, but to be honest I've never seen it or worried about it.
 
Abdul Kader
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your comments.

Is there any way we can remove the servlet or Java Object from JVM or from the Server Memory.

What will be right answer for this question.??
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Abdul,

Once again

------------------------------------------------

we no need to worry about that...that is the job for container and Garbage collection system(automatic memory management system)

----------------------------------------------

thanks & regards,
seetharaman
 
winay Kumar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Abdul,

if you want to remove any unreferred objects from JVM you can call Grabage collector explicitly by calling "System.gc();". but there no guarantee that all unreferred objects will be freed, because JVM may or may not execute that method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!