tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Hundreds of Instances
Date Tue, 04 Dec 2007 14:56:10 GMT
Hash: SHA1


Breno Jacinto wrote:
>> Tomcat itself is extremely stable. This is most likely an application
>> problem. Perhaps your application does well with little traffic but does
>> not scale well. You got a burst of traffic and everything fell apart. ??
>     Not really. I dont have the exact numbers, but I think we'd get at
> most 50 users every 10 minutes = 5 users / min. I believe that´s
> pretty low.

Is that estimated, or measured?

> I assume the garbage collector cleans them all.

As long as you are putting those search results only into request
attributes or something like that for temporary storage, you should be
okay. Don't forget that a single *huge* result set can still cause an
OOME if you don't have enough memory allocated.

> Yeah, its not crashing. Nor the JVM either. They get very, very
> slow because Linux starts to swap like crazy, after the Tomcat process
> eats almost 100% of RAM.

Gotcha. How much memory do you have configured for the JVM, and how much
memory is actually free? IF you're swapping a lot, maybe you need to a)
buy more memory or b) lower the memory allocation to your app. Of
course, lowering your memory allocation could lead to OOME, but both
problems are effectively the same.

> I'm pretty sure it´s not a burst, but
> something that progressively gets allocated and not deallocated. I'm
> not sure why, but thanks for the idea of the profiler. I'll dig for
> one.

The memory profiler is your best bet. Look at, say, 24 hours worth of GC
activity (if your server stays up that long). You should have a GC curve
that looks like this: /\/\/\/\/\/\/\/\/\/. If if goes up and up and up,
you obviously have a memory leak. If it only goes up at intervals (say,
once an hour), then maybe you have a rare event or timed event that
leaks, rather than something that happens all the time (say, with every
That will give you some idea of what you are looking for.

Oh, and don't freak out when you find out how much memory is consumed by
char[] objects ;)

- -chris
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message