java -xms是什么,讓我們一起了解一下?
-xms是用來設置你的應用程序能夠使用的最大內存數,如果程序要花很大內存的話,那就需要修改增加此數的值。-Xms設置初始Java堆,-Xmx設置最大Java堆。
在Java中,-Xms和-Xmx參數的作用是什么?
其實在Java中, -Xms設置初始Java堆大小,而-Xmx設置最大Java堆大小。
1、一些java -Xms -Xmx示例:
#?Start?with?128MB?of?memory,?and?allow?the?Java?process?to?use?up?to?1024MB?of?memory.? java?-Xms128m?-Xmx1024m
#?Start?with?256MB?of?memory,?and?allow?the?Java?process?to?use?up?to?4G?(4096MB)?of?memory. java?-Xms256m?-Xmx4g
2、默認的初始和最大Java堆大小是根據這種人體工程學算法分配的。
3、如果Java進程超出了-Xmx最大Java堆大小,則將引發流行的java.lang.OutOfMemoryError?。
4、對于其他選項,請運行此java -X。
>?java?-X -Xbatch???????????disable?background?compilation -Xbootclasspath/a:append?to?end?of?bootstrap?class?path -Xcheck:jni???????perform?additional?checks?for?JNI?functions -Xcomp????????????forces?compilation?of?methods?on?first?invocation -Xdebug???????????provided?for?backward?compatibility -Xdiag????????????show?additional?diagnostic?messages -Xfuture??????????enable?strictest?checks,?anticipating?future?default -Xint?????????????interpreted?mode?execution?only -Xinternalversion displays?more?detailed?JVM?version?information?than?the -version?option -Xloggc: ????log?GC?status?to?a?file?with?time?stamps -Xmixed???????????mixed?mode?execution?(default) -Xmn ????????sets?the?initial?and?maximum?size?(in?bytes)?of?the?heap for?the?young?generation?(nursery) -Xms ????????set?initial?Java?heap?size -Xmx ????????set?maximum?Java?heap?size -Xnoclassgc???????disable?class?garbage?collection -Xrs??????????????reduce?use?of?OS?signals?by?Java/VM?(see?documentation) -Xshare:auto??????use?shared?class?data?if?possible?(default) -Xshare:off???????do?not?attempt?to?use?shared?class?data -Xshare:on????????require?using?shared?class?data,?otherwise?fail. -XshowSettings????show?all?settings?and?continue -XshowSettings:all show?all?settings?and?continue -XshowSettings:locale show?all?locale?related?settings?and?continue -XshowSettings:properties show?all?property?settings?and?continue -XshowSettings:vm show?all?vm?related?settings?and?continue -XshowSettings:system (Linux?Only)?show?host?system?or?container configuration?and?continue -Xss ????????set?java?thread?stack?size -Xverify??????????sets?the?mode?of?the?bytecode?verifier
以上就是小編今天的分享了,希望可以幫助到大家。