Difference between XMS and XMX flags for java

The Xmx flag specifies the maximum memory allocation pool for the Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool.

That means your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory.

For example, starting a JVM like so will start it with 256MB of memory, and will allow the process to use up to 2048MB of memory:

java -Xmx2048m -Xms256m