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?
3 个解决方案
#1
47
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
厦门
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.
使用-Xgcpolicy:gencon时,将新(托儿所堆)的初始和最大大小设置为指定值。相当于同时设置-Xmns和-Xmnx。如果设置-Xmns或-Xmnx,就不能设置-Xmn。如果您试图用-Xmns或-Xmnx设置-Xmn,那么VM将不会启动,返回一个错误。默认情况下,-Xmn是根据系统的功能在内部选择的。您可以使用-verbose:size选项来查找VM当前使用的值。
#2
6
From GC Performance Tuning training documents of Oracle:
Oracle的GC性能调优培训文档:
-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.
简而言之,它将新生成的新大小和MaxNewSize值设置为相同的值。
#3
4
-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" .
-Xmn:年轻一代堆的大小表示所有生命周期短的对象。年轻生成对象位于堆的特定位置,垃圾收集器将经常在这里传递。所有新对象都被创建到年轻一代区域(称为“伊甸园”)。当一个对象在超过2-3个gc清理后仍然“存活”时,交换器将具有“老一代”:它们是“幸存者”。
Good size is 33%
良好的大小是33%
源
#1
47
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
厦门
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.
使用-Xgcpolicy:gencon时,将新(托儿所堆)的初始和最大大小设置为指定值。相当于同时设置-Xmns和-Xmnx。如果设置-Xmns或-Xmnx,就不能设置-Xmn。如果您试图用-Xmns或-Xmnx设置-Xmn,那么VM将不会启动,返回一个错误。默认情况下,-Xmn是根据系统的功能在内部选择的。您可以使用-verbose:size选项来查找VM当前使用的值。
#2
6
From GC Performance Tuning training documents of Oracle:
Oracle的GC性能调优培训文档:
-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.
简而言之,它将新生成的新大小和MaxNewSize值设置为相同的值。
#3
4
-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" .
-Xmn:年轻一代堆的大小表示所有生命周期短的对象。年轻生成对象位于堆的特定位置,垃圾收集器将经常在这里传递。所有新对象都被创建到年轻一代区域(称为“伊甸园”)。当一个对象在超过2-3个gc清理后仍然“存活”时,交换器将具有“老一代”:它们是“幸存者”。
Good size is 33%
良好的大小是33%
源