Sunday, 12 January 2020

What are -Xms and -Xmx parameters while launching java application?

-Xms and -Xmx options are used to set heap size of your java application.

Option
Description
-Xms
Set initial and minimum heap size
-Xmx
Set maximum heap size

JVM heap can vary its Current heap size between two preconfigured memory boundaries, the initial heap size (defined by the –Xms option) and the maximum heap size (defined by the –Xmx option)

Syntax
-Xms<size>[g|G|m|M|k|K]
-Xmx<size>[g|G|m|M|k|K]

Example
java -Xmx5000M {APPLICATION_NAME}

Above statement launch given application by setting maximum heap size to 5000mb.
You may like

No comments:

Post a Comment