tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Do I Have Java Memory Fragmentation?
Date Mon, 19 Dec 2011 22:19:12 GMT
Pid wrote:
> On 19/12/2011 19:41, Leon Rosenberg wrote:
>> Do a simple math. If you give each VM up to 384M heap and if you add
>> some 100 MB for permspace and overhead, you have a consumption of
>> 500MB per VM. 
> Agreed.  Object heap != total process usage.
>> Take 1GB for OS needs, you have 15, and 15.000/500 makes
>> it save to run 30 tomcat instances max.
>> Since you experience the problems after some running time, I would
>> assume that you VMs are starting with 128 but slowly take up all the
>> space, and the later VMs just have nothing to get.
> Is the OP monitoring the JVM memory consumption (via a JMX connection)?
>> Advice: Calculate your needs exactly by playing with settings
>> (remember always set Ms=Mx) and watching gc logs. You will probably
>> need to reduce the number of instances or buy another machine (or put
>> more memory into this one).
> It would be useful to establish what is consuming memory once Tomcat
> instances have failed.  Is it failed JVM instances that have hung and
> are still consuming memory, or is it something more exotic to do with
> the hypervisor?
> Fixing memory size will offer some gains, but you need to understand
> what each instance is actually doing, rather than using a standard.
>> Also, do you really need a separate instance for each webapp? You have
>> 60x catalina code in the heap and everything, which probably takes
>> half of your memory.
> I don't think it's safe to say "catalina code will take half your
> memory", given that we don't know anything about the OPs apps, but it
> may be a reasonable gain to collapse some apps into one Tomcat.

On a 32-bit Linux system, this is what "top" has to say about the memory usage of one 
tomcat 5.5 instance, running one single small app, with -Xms128M -Xmx128M, and totally 
idle for the time being :


  2871 tomcat55  20   0  539m 137m 4560 S  0.0  9.1 129:40.19 jsvc

If one multiplies this by 60, one gets :
RES : +- 8 GB
VIRT : +- 32 GB

There may be some overhead due to jsvc, but that would be the same under Windows with 
Note also that on a 64-bit system like the OP, the numbers above may be somewhat larger.

Which make me muse also that since the OP obviously doesn't need a  very large heap, he 
may benefit, maybe greatly, from running a 32-bit JVM for his Tomcat instances, if that is

allowed under his version of Windows.  He may gain even more by running his VM with a 
32-bit Windows in the first place.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message