Howdy,

>It is so difficult to scale this. using vmstat, I can see my free
memory
>shrinking and shrinking . It is really a case of "suck and see".

The free memory will keep going down until the VM feels it has to
garbage-collect.  You can tune this behavior using other non-standard
options, for example -Xminf, -Xmaxf, -XX:NewSize, -XX:MaxNewSize, and
the various GC algorithms like -Xincgc and -Xconcgc.

>The doco says m or M means MegaBytes
>So does -Xmx256m  mean 256 MegaBytes ???

Yes.

>What do the others mean please

k for KB, g for GB.  But you can probably just make do with m, as that's
the range for most applications.  For example:
-Xmx256m means the heap can grow up to 256MB.
-Xmx1024m means the heap can grow up to 1024MB = 1GB.
-Xmx2m means the heap can grow up to 2MB.  (I wouldn't do this ;)
Although an early release of J2ME had a 4MB default heap limit I think.
;))

Please keep in mind that OS-level tools, like top and vmstat, display
the process space, which is more than the heap.  The above numbers
control just the heap.  In practice, overhead like thread addressing,
locks, etc, add more to the process space.  So the numbers you see using
vmstat could exceed the -Xmx number.

How do you check that you setting took effect?  Test it.  Do stuff with
your app that will take 200MB and make sure it works.  Then do stuff
with your app that will take 300MB and make sure it doesn't work, i.e.
get an OutOfMemoryError.  If your app can't do this, why do you need
-Xmx?

But believe me: -Xmx works.  It's become one of the first and most
important things people tune, because JVM sizes are ever-growing.

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