File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Avoiding long gc pauses Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Avoiding long gc pauses" Watch "Avoiding long gc pauses" New topic

Avoiding long gc pauses

Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368

I have a web application running on tomcat. The problem I am facing is that occasionally the full gc pauses become abnormally long (>100 secs).

In order to address it, I used concurrent mark sweep for gc as the hardware has multicore processor but it did not solve the problem completely. Any guidelines/directions on what else can be done to address this.


Thanks and Regards
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Can you share JVM options used to start Tomcat.
Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

Some suggestions:

Increase the socket.bufferPool. Default is 500. Could be a lot more.

Use multiple Tomcats. Two Tomcat instances running on the same machine and having a load balancer (like HTTPD or similar) as common front is often less prone to do large gc hangups.

I have found this page to be most useful when dealing with TC performance.
Jayesh A Lalwani
Saloon Keeper

Joined: Jan 17, 2008
Posts: 2749

Have you taken a heap dump to see where memory is being used? You need to find out first where memory is being used? Is it your app or Tomcat?
I agree. Here's the link:
subject: Avoiding long gc pauses
It's not a secret anymore!