-Xms 初始化对内存大小
为了更好的性能把 -Xms 与-Xms 设为一样
如果不设置该值,那么默认根据你运行的模式来决定
-server
mode: 系统25%的物理内存,最大不超过64m,最小8m
-
client
mode: 系统25%的物理内存,最大不超过16m,最小8m
如果设置了 -Xns 默认的xms 会被扩大到至少是-Xns的两倍
-Xmx 最大堆内存
如果不设置该值,那么默认的值根据平台和的系统的内存来决定,具体如下:
Release
|
|
Default Maximum Heap Size
|
---|
|
|
75% of total physical memory up to 1 GB
|
|
|
50% of available physical memory up to 1 GB
|
|
Windows on a 64 bit platform
|
75% of total physical memory up to 2 GB
|
|
Linux or Solaris on a 64 bit platform
|
50% of available physical memory up to 2 GB
|
|
Windows on a 32 bit platform
|
75% of total physical memory up to 1 GB
|
|
Linux on a 32 bit platform
|
50% of available physical memory up to 1 GB
|
注:-Xmx 必须大于或等于 -xms
-Xmx 必须大于或等于 -xns
-Xmx 最小为16mb