What is the difference between xmx and MaxRAM JVM parameters?

前端 未结 1 1274
醉话见心
醉话见心 2020-12-10 12:57

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 InitialRA

相关标签:
1条回答
  • 2020-12-10 13:37

    -Xmx specifies the precise upper limit for the heap. It is the preferred way to set the heap size.

    -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.

    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.

    0 讨论(0)
提交回复
热议问题