Friday, October 5, 2012

Why do we set -Xms and -Xmx to the same value?

There is an additional performance overhead when the memory grows from the initial -Xms to -Xmx when system requires additional memory due to reasons like load etc. Its recommended to have the -Xmx and -Xms of the same value so that during the JVM startup process itself the memory is allocated and overhead due to additional progressive growth is avoided. Now in this sense the question remains then why have an -Xms setting in the first place. There might be systems that rarely reach the -Xmx heap value and hence to optimize resource utilization the -Xms setting makes sense. 

 config can prevent overhead of memory manipulating and decrease frequency of garbage collection :)

No comments:

Post a Comment