> From: Robinson, Eric [eric.robin...@psmnv.com]
> Is there a way to tell what the optimal
> heap size is for our application, and whether the current small size is
> effecting performance (aside from trial-and-error or repeated
> benchmarking with tools like jmeter)?

Smaller heap sizes may lead to more frequent garbage collection, which costs 
CPU cycles* and hence affects performance.  If your app is spending much of its 
time in the garbage collector, increasing heap would help - but it's then a 
process of trial-and-error to work out what the "optimal" size is, as it's a 
trade-off between %CPU spent in garbage collection and memory.

As a sketch, I'd turn on some of the GC monitoring in the virtual machine and 
see if you can get a feel for how much time it's spending in the GC.  Most of 
my apps are well below 1%, though I have one (.Net app) that spends c. 98% of 
its time in the GC as it loads state from disk.

You also need to decide what's "good enough".  The difference in "real-world" 
performance between spending 0.1% and 1% in the GC is negligible; the 
difference between 10% and 90% is rather obvious!

- Peter

* Some of the cycles would be spent no matter when the garbage happened to be 
collected; others are overhead each time, though GC algorithms have improved a 
lot and the overhead's far lower than it used to be.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to