论坛首页 入门技术论坛

增加windows下Tomcat运行时的内存

浏览 2568 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2012-06-11  

注意:本方法仅针对windows下非安装版本的Tomcat

1.命令行启动Tomcat的场合,修改%TOMCAT_HOME%\bin\catalina.bat

修正前:
rem ----- Execute The Requested Command ---------------------------------------

echo Using CATALINA_BASE:   "%CATALINA_BASE%"
echo Using CATALINA_HOME:   "%CATALINA_HOME%"
echo Using CATALINA_TMPDIR: "%CATALINA_TMPDIR%"


修正后:
rem ----- Execute The Requested Command ---------------------------------------

set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xms512m -XX:PermSize=512M
echo Using CATALINA_BASE:   "%CATALINA_BASE%"
echo Using CATALINA_HOME:   "%CATALINA_HOME%"
echo Using CATALINA_TMPDIR: "%CATALINA_TMPDIR%"

2.添加到windows服务的场合,修改%TOMCAT_HOME%\bin\service.bat,修正后重新添加一次服务就ok了

修正前:
"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed" --StartMode jvm --StopMode jvm

修正后:
"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Xms512m;-Xmx512m;-XX:PermSize=512M;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed" --StartMode jvm --StopMode jvm
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics