xmx和MaxRAM JVM参数之间有什么区别? [英] What is the difference between xmx and MaxRAM JVM parameters?
问题描述
MaxRAM :
基于计算机上的内存量.用于堆的内存比例由命令行选项InitialRAMFraction和MaxRAMFraction控制 [...] MaxRAM的值取决于平台.
based on the amount of memory on the machine. The proportion of memory to use for the heap is controlled by the command-line options InitialRAMFraction and MaxRAMFraction [...] The value of MaxRAM is platform-dependent.
Xmx :
-Xmxn 指定内存分配池的最大大小(以字节为单位).此值必须是大于2 MB的1024的倍数.追加字母k或K表示千字节,或者追加m或M表示兆字节.默认值为64MB.在Solaris 7和Solaris 8 SPARC平台上,此值的上限大约为4000m,在Solaris 2.6和x86平台上,该值的上限为2000m(减去开销).
-Xmxn Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 64MB. The upper limit for this value will be approximately 4000m on Solaris 7 and Solaris 8 SPARC platforms and 2000m on Solaris 2.6 and x86 platforms, minus overhead amounts.
据我了解,两者均定义heap
的大小.不?建议使用什么:Xmx
或MaxRAM
?如果我同时使用两个卵子?
As I understand both define heap
size. No? What is recommended to use: Xmx
or MaxRAM
? If I use both which one ovverides another?
推荐答案
-Xmx
指定堆的精确上限.这是设置堆大小的首选方法.
-Xmx
specifies the precise upper limit for the heap. It is the preferred way to set the heap size.
-XX:MaxRAM
不会直接定义堆大小.取而代之的是,此参数在根据人体工程学计算堆限制时会覆盖物理RAM的实际数量.
-XX:MaxRAM
does not define the heap size directly. Instead this parameter overrides the actual amount of physical RAM when calculating the heap limits basing on ergonomics.
如果设置了-Xmx
,则从不使用MaxRAM
.否则,估计最大堆大小 1 为
If -Xmx
is set, MaxRAM
is never used. Otherwise the maximum heap size is estimated1 as
MaxHeapSize = MaxRAM * MaxRAMPercentage / 100% (default MaxRAMPercentage=25)
1 The actual algorithm is a bit more complicated and depends on other parameters.
这篇关于xmx和MaxRAM JVM参数之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!