Hitachi

uCosminexus Application Server System Design Guide


7.8 Deciding the maximum size or the initial size of Java heap

If you have estimated the Tenured area and the New area, then based on the estimated area, decide the maximum size and the initial size of Java heap.

Decide the maximum size of Java heap in the following manner:

Maximum-size-of-Java-heap
= memory-size-of-the-Tenured-area + memory-size-of-the-New-area

When setting the memory size of Java heap, first, specify the maximum size of Java heap, including the size of the extended area, in the -Xmx option. Next, specify the initial size of the Java heap in the -Xms option. The size specified in the -Xms option has to be lesser than that specified in the -Xmx option.

At the time of startup, JavaVM allocates only that much memory area as the Java heap that has been specified in the -Xms option. Later, if memory area more than what is specified in the -Xms option is required during execution of an application, JavaVM keeps adding and allocating the heap area until it reaches the size specified in the -Xmx option. Conversely, if there is some unnecessary memory space in an application, then JavaVM keeps reducing the area that has been allocated as the Java heap, until it reaches the size specified in the -Xms option.

For stable operations of a system, Hitachi recommends that you specify the same value in the -Xmx option and the -Xms option.