What does -Xmn jvm option stands for

JavaJvm Arguments

Java Problem Overview


I tried searching the internet about -Xmn option, without success.

Can someone please explain what this stands for and how can I use it to tune JVM?

Java Solutions


Solution 1 - Java

From here:

>-Xmn : the size of the heap for the young generation > >Young generation represents all the objects which have a short life of time. Young generation objects are in a specific location into the heap, where the garbage collector will pass often. All new objects are created into the young generation region (called "eden"). When an object survive is still "alive" after more than 2-3 gc cleaning, then it will be swap has an "old generation" : they are "survivor".

And a more "official" source from IBM:

>-Xmn > >Sets the initial and maximum size of the new (nursery) heap to the specified value when using -Xgcpolicy:gencon. Equivalent to setting both -Xmns and -Xmnx. If you set either -Xmns or -Xmnx, you cannot set -Xmn. If you attempt to set -Xmn with either -Xmns or -Xmnx, the VM will not start, returning an error. By default, -Xmn is selected internally according to your system's capability. You can use the -verbose:sizes option to find out the values that the VM is currently using.

Solution 2 - Java

From GC Performance Tuning training documents of Oracle:

> -Xmn[size]: Size of young generation heap space. > > Applications with emphasis on performance tend to use -Xmn to size the > young generation, because it combines the use of -XX:MaxNewSize and > -XX:NewSize and almost always explicitly sets -XX:PermSize and -XX:MaxPermSize to the same value.

In short, it sets the NewSize and MaxNewSize values of New generation to the same value.

Solution 3 - Java

> -Xmn : the size of the heap for the young generation Young generation represents all the objects which have a short life of time. Young generation objects are in a specific location into the heap, where the garbage collector will pass often. All new objects are created into the young generation region (called "eden"). When an object survive is still "alive" after more than 2-3 gc cleaning, then it will be swap has an "old generation" : they are "survivor" .

>Good size is 33%

Source

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBhushanView Question on Stackoverflow
Solution 1 - JavaawkspView Answer on Stackoverflow
Solution 2 - JavaeaorakView Answer on Stackoverflow
Solution 3 - JavadimoniyView Answer on Stackoverflow