What does -Xmn jvm option stands for
Asked Answered
S

3

68

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?

Slot answered 27/5, 2014 at 4:5 Comment(2)
Should be -Xms. Isn't it?Lambrequin
@AbimaranKugathasan There is a -Xmn flag that's different than -XmsForereach
F
77

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.

Forereach answered 27/5, 2014 at 4:10 Comment(2)
First source is wrong. It is size of the young generation not only eden(whichisonly a part of the young gen)Whore
@piotrek I'll take your word for it. Thanks!Forereach
H
13

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.

Heteroplasty answered 9/12, 2015 at 5:9 Comment(0)
S
5

-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

Stadia answered 27/5, 2014 at 4:10 Comment(1)
Source link is dead. Here is the Wayback Machine archive of that link: web.archive.org/web/20140613034154/http://www.avricot.com/blog/…Achaea

© 2022 - 2024 — McMap. All rights reserved.