Anil said:
destroy() will be called when ever we remove the servlet instance from the service.
We dont remove the servlet instance, its upto the container to decide that.
padmapriyagururajan said:
The destroy() method is called after the service method is completed and is called before garbage collection
The spec says this:
Before the servlet container calls the destroy method, it must allow any
threads that are currently running in the service method of the servlet to complete
execution, or exceed a server-defined time limit.
Naresh as the spec says, if all the threads running in service are done and if the container wishes to remove the instance then destroy is called.
You cannot force the container to do it.