what happens if we wont use destroy()?

Answer Posted / rv.nandakishore

Think, if there is 100's of objects are utilizing the
resource(i.e Connection object). That means allocation of
those objects are stored in the internal memory of the JVM
right... If similar requests are utilizing the Connection
object.... at one time the JVM utilization memory is full...
this will degrade the application. For this reason we call
explicitly destroy()...... if not the Garbage Collector will
taken care to reclaim the memory.... by we don's say when it
will be reclaim the memory and free the JVM memory......

Is This Answer Correct ?    20 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between GET and POST?

703


Why is httpservlet declared abstract?

576


How do you load an image in a Servlet?

652


Why servlet is used as controller ? Not JSP? I want complete explation?

646


What is difference between GenericServlet and HttpServlet?

562






Write the code to get the server information in servlet.

564


What is the difference in between the httpservlet and generic servlet?

599


Why do we have servlet filters?

593


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

543


What are the uses of servlet

627


What do you mean by url pattern in servlet?

619


What is the purpose of inter-servlet communication?

585


How to read request headers from servlets?

562


How can we create deadlock situation in servlet?

830


How can the session in servlet be destroyed?

637