>From: "Brandt, Mark H" <[EMAIL PROTECTED]>
>
>Anyone have a recommended virtual machine size for running
>java/tomcat on z/Linux SuSe SLES9 SP2?  Also what are the
>recommended params to specify heap space for the apps (Xms and
>Xmx).=20
>

I sent this question to my java development group, this is
their quick response.

Barton,

Quick Answer:  Xms = Xmx = 1/4 of the physical memory.  (adapted
from
http://java.sun.com/docs/hotspot/gc5.0/ergo5.html#0.0.%20Garbage%20collector,%20
heap,%20and%20runtime%20compiler%7Coutline)


Long Answer:

Java heap size recommendations can be a tricky business.

Simple formula Xms = Xmx = memory - stack - library.

If you have infinite resources then you want to "max out" your
heap sizes - this prevents out of memory exceptions which will
crash your app, as well as unnecessary garbage collection.  The
author of the question likely already knows this, but possibly
not.  So a naive answer is to recommend that the user use the
same value for the heap as the max address space allowed by the
operating system minus the stack and library requirements.  Stack
and library requirements can be determined with a Java profiler.
You may want to return that answer along with the max address
space allowed by z/Linux SuSe SLES9 SP2.  On 32 bit Linux 1900m
should work fine
(http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=56&t=004
365)

However, better performance can be achieved if the app monitors
its available memory and the JVM is set to prevent paging.  This
is dependant on the other processes running on the machine.
Figure out how much physical memory is available for the JVM and
then apply the formula.

If you're going to profile the app/tomcat anyway to figure out
the stack and library requirements, you may as well use it to
gauge your heap requirements.  Put tomcat (with your app) through
a stress test while it's being profiled.  Set your Xmx and Xms
values to 5-10% above the greatest value seen in the test.  Then
you can be sure that you're running your app with as small a
footprint as possible.

Last note:  I'm lazy and don't need optimum performance so I
usually just set the values to about 1/2 physical memory (if
it's the only app on the OS then I would go with about 7/8ths).
If I get an out of memory exception down the road I'll increase
the number, if I can't spare the memory I decrease the number
and let it crash when it has to (I don't use them, but tomcat
clusters make it so that that's not as bad as it sounds, and you
can monitor the app and restart it automatically).

Hope this helps,
Chris








"If you can't measure it, I'm Just NOT interested!"(tm)

/************************************************************/
Barton Robinson - CBW     Internet: [EMAIL PROTECTED]
Velocity Software, Inc    Mailing Address:
 196-D Castro Street       P.O. Box 390640
 Mountain View, CA 94041   Mountain View, CA 94039-0640

VM Performance Hotline:   650-964-8867
Fax: 650-964-9012         Web Page:  WWW.VELOCITY-SOFTWARE.COM
/************************************************************/

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to