如何设置 JAVA_OPTS

Python014

如何设置 JAVA_OPTS,第1张

在windows平台,需要参照如下步骤设置:

1On the taskabar, click Start, and then point to Settings, Control Panel, and System.

2In the System Properties dialog box Advanced tab, click Environment Variables.

3In the Environment Variables dialog box, under System variables, click New.

4In the New System Variable dialog box, enter:

aVariable name: JAVA_OPTS.

bVariable value -Xms256m -Xmx512m

5Click OK.

6Verify that the Environment Variables dialog box displays the following system variable name value pair:

JAVA_OPTS="-Xms256m -Xmx512m "

7Click OK, OK to close the System Properties dialog box.

在linux/unix下,需要参照以下步骤设置

1 Start a terminal session.

2 At the command prompt type:

3 export set JAVA_OPTS=”-Xms256m -Xmx512m”

4 Close the terminal session.

以下给出1G内存环境下java jvm 的参数设置参考:

JAVA_OPTS="-server -Xms800m -Xmx800m -XX:PermSize=64M -XX:MaxNewSize=256m -XX:MaxPermSize=128m -Djava.awt.headless=true "

JAVA_OPTS="-server -Xms768m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=256m -XX:

NewSize=192m -XX:MaxNewSize=384m"

CATALINA_OPTS="-server -Xms768m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=256m

-XX:NewSize=192m -XX:MaxNewSize=384m"