Sun has made the exception 'OutOfMemory' to be
under the control of Java VM.
Why?
Besides ..
Though Java VM has the options 'MinHeapFreeRatio' and
'MaxHeapFreeRatio', she has the option 'Xmx'.
Why is 'Xmx' needed ?
When a program has the trouble like 'OutOfMemory',
it is not a valid way to increase the value of 'Xmx'
because you are not very sure that the max memory
size of the program will be 'xxxx' MBytes.
Let's consider a program that shows the list of user data.
The max size of user data is unknown for the most part.
And the magnitude of data displayed on the program is
at the discretion of user. Therefore,
the max memory size of the program is not determinate.
I think that the exception like 'OutOfMemory' has to be
under the control of OS, not Java VM.
What is your comment ?
Thanks.
Mladen Adamovic - 11 Jun 2006 19:56 GMT
> I think that the exception like 'OutOfMemory' has to be
> under the control of OS, not Java VM.
In that case if you have memory leaks (i.e. improper handling of the
linked list) one JVM can take all the memory.
If you have several Tomcat servers on one computer (round robin on dual
core computer) you have more JVM which cannot take as much memory as
they would like so there are advantages of that approaches.
But, I agree, in most cases it could be under the control of OS and to
give as much memory as available to JVM.

Signature
Mladen Adamovic
http://www.online-utility.org http://www.shortopedia.com
http://www.froola.com http://www.gift-idea4u.com