Java选项-Xmx代表什么? [英] What does Java option -Xmx stand for?

查看:217
本文介绍了Java选项-Xmx代表什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java -Xmx1024m文件名

-Xmx 意思是?

推荐答案

见这里: Java工具文档,它说,


-Xmx n

指定内存分配池的最大大小(以字节为单位)。此值必须是1024的倍数大于2MB。附加字母k或K表示千字节,或m或M表示兆字节。默认值为64MB。此值的上限在Solaris 7和Solaris 8 SPARC平台上约为4000米,在Solaris 2.6和x86平台上约为2000米,减去开销金额。示例:

-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堆内存设置为可用内存最大为1024 MB,不会更多。

So, in simple words, you are setting Java heap memory to a maximum of 1024 MB from the available memory, not more.

请注意-Xmx和1024m之间 NO SPACE

Notice there is NO SPACE between -Xmx and 1024m

如果使用大写或小写,则无关紧要。例如:-Xmx10G和-Xmx10g完全相同。

It does not matter if you use uppercase or lowercase. For example: "-Xmx10G" and "-Xmx10g" do the exact same thing.

这篇关于Java选项-Xmx代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆