Hi,

>> I'me sure this one has been done to death but does anyone have any
>> guidelines on the settings of -Xms and -Xmx ($CATLINA_OPTS), or how
to
>> derive the optimal setting for these ?

Yes, it has been asked many times.  That's because everyone seems to
think there's a magical guideline somewhere.  There isn't.  To get the
best performance for your application, you have to profile your
application.

-Xmx is the key setting, you should start with tuning that.  As long as
you keep getting OutOfMemory errors, you need to increase -Xmx.  You
need to give yourself enough memory for peak traffic, and then some for
safety and overhead.  So run your app again and again with a load test
tool, see how much traffic you can handle and how much memory it
requires.

Once you've found the proper value for -Xmx, think about -Xms, the
minimum size.  Setting this close to -Xmx will speed up your server
startup if you cache a lot stuff on startup.  However, if your normal
usage pattern requires very little memory, and only peak times require
high memory, you can keep this low to avoid taking up memory
unnecessarily.

Keep -verbose:gc on so that you can see what garbage collection is
doing.  If you have a big heap, GC may take more time, and may create
visible pauses to your users.  Experiment with the various GC algorithms
(-Xincgc etc.) to see if they work well.

By that point you should be a bit more familiar with and comfortable
with more advanced tuning.  Analyze your app to get an estimate of the
breakdown between the young and old GC generations.  Tuning -XX:NewSize
and -XX:MaxNewSize can help a *lot*.  

Good luck,

Yoav Shapira
Millennium ChemInformatics
This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to