I would say you are barking on a wrong tree in suspecting the garbage collector to be the culprit. Garbage collection not running in time(or in proper intervals) can cause the applicatin to slow down or have spikes in the performance but it will not cause the applicaiton to stop.
Lets try to list out the possible scenarios: 1. You have a memory leak and thus you are losing memory every time you invoke the servlet. In this case, you should end up with an OutOfMemoryException. 2. Your servlets are not going back to the servlet pool and hence tomcat has starting to queue up the further requests. In this case, it will appear as if Tomcat has stopped responding. Check the state of your server queue to see if you have requests waiting there. 3. You have a deadlock in your code. Take the thread dump and see if there is one. As for garbage collector, you can use System.gc() but even that doesn't ensure that the garbage collector will be invoked. Better option usually is to tune the GC parameters but all that helps is with the performance. If you have a memory leak, even invoking GC won't help. On 11/22/06, Daniel L. Gross <[EMAIL PROTECTED]> wrote:
Is there a way to force Tomcat 5.5 to run a garbage collection? Thanks, Dan Caldarale, Charles R wrote: >>From: Daniel L. Gross [mailto:[EMAIL PROTECTED] >>Subject: Re: Memory Usage >> >>I have run the lamda probe on the software, but it >>didn't show anything useful. >> >> > >It's not a profiler, and was never intended to be. > > > >>Where do I turn on the -verbose:gc? In the tomcat start-up script? >> >> > >It's a standard java launcher option. If you're running from a script, >try setting it in JAVA_OPTS before kicking off the script. > > - Chuck > > >THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY >MATERIAL and is thus for use only by the intended recipient. If you >received this in error, please contact the sender and delete the e-mail >and its attachments from all computers. > >--------------------------------------------------------------------- >To start a new topic, e-mail: users@tomcat.apache.org >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > >
Gaurav Singh Kushwaha http://www.chakpak.com Ph: +91-9880101496 Bangalore, India.