catalina.bat中适当的位置设置JAVA_OPTS [英] Appropriate place in catalina.bat to set JAVA_OPTS
问题描述
我收到以下错误
"java.lang.OutOfMemoryError: PermGen space"
在我的 catalina.bat
文件中,输入<$的适当位置在哪里c $ c>设置JAVA_OPTS 参数?文件的底部或任何其他地方?
In my catalina.bat
file, where is the appropriate place for enter set JAVA_OPTS
parameter? Bottom of the file or any other place?
推荐答案
请阅读: OutOfMemory错误 并确保您的应用程序没有内存泄漏和过多的内存使用情况。
Please read this: OutOfMemory Error and make sure your application doesn't have memory leak and excessive memory usage.
要更改设置,请为Windows创建名为 setenv.bat
的文件,或者为Linux创建名为 setenv.sh
的文件如下所示:
To change the settings, create a file named setenv.bat
for windows or setenv.sh
for Linux with entry as below:
Windows:
set JAVA_OPTS="-Xms256m -Xmx512m"
Linux:
export JAVA_OPTS="-Xms256m -Xmx512m"
简单地说( setenv.bat / setenv.sh)文件在%CATALINA_HOME%\ bin \
文件夹中。您的命令文件( catalina.bat / catalina.sh
)已经有如下声明:
Simply put this(setenv.bat/setenv.sh) file in %CATALINA_HOME%\bin\
folder. Your command file (catalina.bat/catalina.sh
) already has a statement as below:
Windows:
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
Linux:
if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
. "$CATALINA_BASE/bin/setenv.sh"
elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
. "$CATALINA_HOME/bin/setenv.sh"
fi
这将照顾其余的。
这篇关于catalina.bat中适当的位置设置JAVA_OPTS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!