Join the Stack Overflow Community
Stack Overflow is a community of 6.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

-Xms is to specify initial heap size or minimum heap size? I see lot of places with lot of different answers. Some like second answer here, say that it is for initial heap and some like here say that its minimum heap size. Or is it that the minimum size itself is the initial size?

share|improve this question
    
I know this is an old post, but now some of the links are broken... – CCovey Apr 7 '15 at 1:59
up vote 29 down vote accepted

The initial heap size is the minimum heap size. It won't get smaller than the initial heap size.

From Tuning Garbage Collection with the 5.0 Java[tm] Virtual Machine:

By default, the virtual machine grows or shrinks the heap at each collection to try to keep the proportion of free space to live objects at each collection within a specific range. This target range is set as a percentage by the parameters -XX:MinHeapFreeRatio= and -XX:MaxHeapFreeRatio=, and the total size is bounded below by -Xms and above by -Xmx .

share|improve this answer
    
By default in my machine taking 10 gb of maximum heap size because we have 40 gb memory. When i set -Xms15g, what was the maximum size ? – junsid Mar 18 '16 at 5:45

From running java -X:

-Xms<size>        set initial Java heap size
-Xmx<size>        set maximum Java heap size
-Xss<size>        set java thread stack size

Note that -X options are not guaranteed to exist on all VMs or behave the same on all VMs. For example -Xms could format your hard drive depending on the VM (it would not - but strictly speaking it could :-) (typing java by itself gives the help with this line: "-X print help on non-standard options").

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.