Tomcat – More Memory – CATALINA_OPTS tomcat的内存设置

CATALINA_OPTS or JAVA_OPTS?

CATALINA_OPTS is used to control Tomcat environment options, whereas JAVA_OPTS controls the environment options at a higher level ie. for any Java library.

You can start Tomcat with more heap memory using the following:

On Windows
Edit the file $TOMCAT_HOMEbinstartup.bat and insert or alter the following line, substituting for the desired values:
set CATALINA_OPTS=-Xms(min heap)m -Xmx(max heap)m

For example if you want to allocate a minimum heap size of 256MB and a max heap size of 512MB you will have to write the following on Windows:
set CATALINA_OPTS=-Xms256m -Xmx512m

The line you add should go just before the line starting call “%EXECUTABLE%”…

If you are running tomcat 5.5 via tomcat.exe, you can update the heap size by running tomcatw.exe and setting the required values via the Java tab.

On Linux
Edit the file $TOMCAT_HOME/bin/startup.sh and insert the following line, substituting for the desired value, eg. Bash Shell:
export CATALINA_OPTS=”-Xms(min heap)m -Xmx(max heap)m”

The line you add should go just before the line starting exec “$PRGDIR…

Permanent Generation Size

If you get the error message: java.lang.OutOfMemoryError: PermGen space you need to add the argument -XX:MaxPermSize=128m to CATALINA_OPTS, in addition to any argument you use to set the heap size.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值