Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are a happy group of developers in venezuela who developed a tomcat5.5+java+spring+hibernate+mysql+jstl+(flex) application. Now we installed them to customers and make them happy, each of them in their own domain. We use Linode as hosting provider, and cpanel's WHM software to help us create accounts rapidly, and mantain the mail server's and stuff. And give users acces to their mail accounts.

So, we were all getting along until my tomcat started to stop working from time to time, gave memory error, restarted the tomcat and all was fine again. Got more clients, bought more hardware until hardware did not make any difference, learned about heap size, now i give more heap size to tomcat, now the whole server falls down from time to time. Connected Jconsole, i can se peaks in memory each 10 minutes, some times less frequency. Te peak is higher each iteration until it breaks. Need tips on how to scale this kind of application, so i ask for the big guys (you guys) for any tips, directions, anything, for scaling my architecture. Thank you!

share|improve this question
It sounds like you've got a horrible memory leak – mahnsc Aug 2 '11 at 22:05
Agreed, I'd stop worrying about Tomcat and start worrying about why your application memory doesn't go down to the same point after each peak. – EightBitTony Aug 2 '11 at 22:17
i see, so the peak SHOULD not increase ! that is not normal in a java application, and its called a memory leak. Well check on that then and write back my findings. – Ernest Aug 3 '11 at 21:30

If the whole server falls you are posibly allocating too much memory for the JVM. You must leave some room for the os, network connections and buffers. On the JVM side, if your memory usage is continuously growing you have some kind of leak or are keeping sessions too much time, or simply allocated memory is not enough for this user number. Take some metrics about memory usage per session.

The jvm behaviour is to allocate memory as long as it free, when it cannot find free memory any more then it garbage collects (partial gc or full gc depending on memory pressure), you should check the lower point after garbage collections to see if its going higher with each gc. Also check gc times, if your application is spending too much time in gc and you cannot give it more memory is time to scale out and load balance.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.