猿问

Java选项-Xmx代表什么?

Java选项-Xmx代表什么?

java -Xmx1024m filename

什么-Xmx意思?


千万里不及你
浏览 3974回答 3
3回答

繁花如伊

看到这里:Java Tool Doc,它说,-Xmx n指定内存分配池的最大大小(以字节为单位)。此值必须是1024的倍数大于2MB。附加字母k或K表示千字节,或m或M表示兆字节。默认值为64MB。此值的上限在Solaris 7和Solaris 8 SPARC平台上约为4000米,在Solaris 2.6和x86平台上为2000米,减去开销金额。例子:           -Xmx83886080            -Xmx81920k            -Xmx80m因此,简单来说,您将Java堆内存设置为可用内存最多1024 MB,而不是更多。请注意,-Xmx和1024m之间没有空格如果使用大写或小写,则无关紧要。例如:“-Xmx10G”和“-Xmx10g”完全相同。

慕田峪9158850

C:\java -X&nbsp; &nbsp; -Xmixed&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mixed mode execution (default)&nbsp; &nbsp; -Xint&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;interpreted mode execution only&nbsp; &nbsp; -Xbootclasspath:<directories and zip/jar files separated by ;>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set search path for bootstrap classes and resources&nbsp; &nbsp; -Xbootclasspath/a:<directories and zip/jar files separated by ;>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; append to end of bootstrap class path&nbsp; &nbsp; -Xbootclasspath/p:<directories and zip/jar files separated by ;>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prepend in front of bootstrap class path&nbsp; &nbsp; -Xnoclassgc&nbsp; &nbsp; &nbsp; &nbsp;disable class garbage collection&nbsp; &nbsp; -Xincgc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enable incremental garbage collection&nbsp; &nbsp; -Xloggc:<file>&nbsp; &nbsp; log GC status to a file with time stamps&nbsp; &nbsp; -Xbatch&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;disable background compilation&nbsp; &nbsp; -Xms<size>&nbsp; &nbsp; &nbsp; &nbsp; set initial Java heap size&nbsp; &nbsp; -Xmx<size>&nbsp; &nbsp; &nbsp; &nbsp; set maximum Java heap size&nbsp; &nbsp; -Xss<size>&nbsp; &nbsp; &nbsp; &nbsp; set java thread stack size&nbsp; &nbsp; -Xprof&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; output cpu profiling data&nbsp; &nbsp; -Xfuture&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enable strictest checks, anticipating future default&nbsp; &nbsp; -Xrs&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reduce use of OS signals by Java/VM (see documentation)&nbsp; &nbsp; -Xcheck:jni&nbsp; &nbsp; &nbsp; &nbsp;perform additional checks for JNI functions&nbsp; &nbsp; -Xshare:off&nbsp; &nbsp; &nbsp; &nbsp;do not attempt to use shared class data&nbsp; &nbsp; -Xshare:auto&nbsp; &nbsp; &nbsp; use shared class data if possible (default)&nbsp; &nbsp; -Xshare:on&nbsp; &nbsp; &nbsp; &nbsp; require using shared class data, otherwise fail.The -X options are non-standard and subject to change without notice.

撒科打诨

-Xmx选项更改VM的最大堆空间。java -Xmx1024m表示VM最多可以分配1024 MB。通俗地说,这意味着应用程序最多可以使用1024MB内存。
随时随地看视频慕课网APP

相关分类

Java
我要回答