看这里:Java Tool Doc,上面写着,
-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. Examples:-Xmx83886080 -Xmx81920k -Xmx80m
因此,简单地说,您将Java堆内存设置为可用内存的最大1024MB,而不是更多.
Notice there is NO SPACE between -Xmx and 1024m
不管你用大写还是小写.例如:"-Xmx10G"和"-Xmx10G"做完全相同的事情.