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

What are the functions of the servlet container?

1035


How to get the current httpsession object?

653


Why do we need servlet filter?

568


What is ServletContext object?

647


How can you use a servlet to generate a plain text instead of html?

594






What are all the ways for session tracking?

593


Define servlet mapping?

660


What is webservlet?

537


What is the difference between get and post methods?

599


When jsessionid is created?

605


What do you mean by deployment descriptor?

555


What are Servlets?

596


How do we go with database connection and log4j integration in servlet?

704


What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?

613


Define the life cycle of a servlets.

572