|
The flag
Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool.This means that 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 below will start it
with 256MB of memory, and will allow the process to use up to 2048MB of
memory:
The memory flag can also be specified in multiple sizes, such as kilobytes, megabytes, and so on.
The Xms flag has no default value, and Xmx typically has a default value of 256MB. A common use for these flags is when you encounter a java.lang.OutOfMemoryError.When using these settings, keep in mind that these settings are for the JVM's heap, and that the JVM can/will use more memory than just the size allocated to the heap. From Oracle's Documentation: Note that the JVM uses more memory than just the heap. For example Java methods, thread stacks and native handles are allocated in memory separate from the heap, as well as JVM internal data structures. |
Wednesday, June 14, 2017
What are the Xms and Xmx parameters when starting JVMs?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment