1. 程式人生 > 其它 >JVM配置引數

JVM配置引數

-XX
標準選擇(Standard Options)
These are the most commonly used options that are supported by all implementations of the JVM.

示例:

-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnable
-XX:+UseFastAccessorMethods


-X
非標準選擇(Non-Standard Options)
These options are general purpose options that are specific to the Java HotSpot Virtual Machine.

示例:

-Xmx256m
-Xms256m
-Xmn768m
-Xss256k

-D
設定系統屬性值(Sets a system property value)
-D屬性名稱=屬性值
Sets a system property value. The property variable is a string with no spaces that represents the name of the property.
The value variable is a string that represents the value of the property. If value is a string with spaces, then enclose it in quotation marks (for example -Dfoo="foo bar").

示例:

-Dspring.profiles.active=release
-Dspring.config.location=/opt/app/conf/

* 如果屬性值中間有空格,需要用雙引號括住,例如-Dclotho="clotho property value"

在IDEA中通過Run/Debug configurations中的VM.options配置

* 如果預設沒顯示,可點選Build and run右邊的Modify options -> Java -> Add VM options