Sun JVM and memory requirements  
Author Message
Vincent van Beveren





PostPosted: 2006-7-21 18:07:00 Top

java-programmer, Sun JVM and memory requirements Hi everybody,

For maximum separation of environment we want to run multiple java
instances (each running a webserver). now at peak moments I want these
to use the maximum heap, however, if the peak moments are passed, it
should free up the heap it doesn't use. Is this possible? Is it even
nessesary? What are the alternatives. I must be able to shut one JVM
down without it affecting the others.

Thanks in advance,
Vincent
 
Thomas Hawtin





PostPosted: 2006-7-21 20:14:00 Top

java-programmer >> Sun JVM and memory requirements Vincent van Beveren wrote:
>
> For maximum separation of environment we want to run multiple java
> instances (each running a webserver). now at peak moments I want these
> to use the maximum heap, however, if the peak moments are passed, it
> should free up the heap it doesn't use. Is this possible? Is it even
> nessesary? What are the alternatives. I must be able to shut one JVM
> down without it affecting the others.

Usually for a server application you want a fixed allocation of memory.
Set -Xms and -Xmx to the same value. It shouldn't be all of the system
memory - you will want some for the operating system and file cache. If
you have variable heap sizes with maximum near physical memory size,
then when all the applications are hit at once the machine will swap badly.

Don't start opening desktop applications on the server. Small
administrative programs should just take physical memory away from the
file cache. Probably the best move is to buy boatloads of RAM.

Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/