Search code examples
javaheap-size

What's the reason to set a minimal Java Heap Size?


I can set the Java Heap Size minimum and maximum by passing the parameters -Xms and -Xmx, respectively.

I understand that the maximum flag is necessary to limit the space, but what's the reason for setting a minimum initial heap size? If the maximum is big enough, the space will increase? Or do i miss something?


Solution

  • Minimun size is set so that the JVM doesn't have to "resize" the heap space if it starts off too small.