简体   繁体   English

-Xmn jvm选项代表什么

[英]What does -Xmn jvm option stands for

I tried searching the internet about -Xmn option, without success. 我尝试在互联网上搜索-Xmn选项,但没有成功。

Can someone please explain what this stands for and how can I use it to tune JVM? 有人可以解释这代表什么,我如何使用它来调整JVM?

From here: 这里:

-Xmn : the size of the heap for the young generation -Xmn:年轻一代的堆大小

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". 当一个物体在超过2-3 gc清洁后仍然“活着”时,它将被交换有一个“老一代”:它们是“幸存者”。

And a more "official" source from IBM : 来自IBM的更“官方”来源:

-Xmn -Xmn

Sets the initial and maximum size of the new (nursery) heap to the specified value when using -Xgcpolicy:gencon. 使用-Xgcpolicy:gencon时,将新(托儿所)堆的初始大小和最大大小设置为指定值。 Equivalent to setting both -Xmns and -Xmnx. 相当于同时设置-Xmns和-Xmnx。 If you set either -Xmns or -Xmnx, you cannot set -Xmn. 如果设置-Xmns或-Xmnx,则无法设置-Xmn。 If you attempt to set -Xmn with either -Xmns or -Xmnx, the VM will not start, returning an error. 如果尝试使用-Xmns或-Xmnx设置-Xmn,则VM将无法启动,并返回错误。 By default, -Xmn is selected internally according to your system's capability. 默认情况下,根据系统的功能在内部选择-Xmn。 You can use the -verbose:sizes option to find out the values that the VM is currently using. 您可以使用-verbose:sizes选项查找VM当前使用的值。

From GC Performance Tuning training documents of Oracle: 来自Oracle的GC Performance Tuning培训文档:

-Xmn [size]: Size of young generation heap space. -Xmn [size]:年轻代堆空间的大小。

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. 强调性能的应用程序倾向于使用-Xmn来调整年轻代的大小,因为它结合了-XX:MaxNewSize和-XX:NewSize的使用,并且几乎总是将-XX:PermSize和-XX:MaxPermSize显式设置为相同的值。

In short, it sets the NewSize and MaxNewSize values of New generation to the same value. 简而言之,它将New GenerationNewSizeMaxNewSize值设置为相同的值。

-Xmn : the size of the heap for the young generation Young generation represents all the objects which have a short life of time. -Xmn :年轻一代的堆的大小年轻一代代表所有具有短暂时间的对象。 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" . 当一个物体在超过2-3 gc清洁后仍然“活着”时,它将被交换有一个“老一代”:它们是“幸存者”。

Good size is 33% 好尺寸是33%

Source 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM