Tomcat 6堆大小 - 这是正确的吗? [英] Tomcat 6 Heap Size - Is this correct?

查看:190
本文介绍了Tomcat 6堆大小 - 这是正确的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Red Hat盒子上运行多个tomcats,我想为每个tomcats配置单独的堆大小(某些实例使用更多内存)。

I am running multiple tomcats on a Red Hat box and I would like to configure separate heap size for each of them (some instances use more memory).

可以我将堆大小min / max bt设置为catalina.sh文件中的以下内容:

Can I set the heap size min/max bt entering the following into the catalina.sh file:

CATALINA_OPTS = - Xms64m -Xmx256m

CATALINA_OPTS="-Xms64m -Xmx256m"

我需要添加'导出'吗?即导出CATALINA_OPTS = - Xms64m -Xmx256m

Do I need add 'export'? i.e. export CATALINA_OPTS="-Xms64m -Xmx256m"

推荐答案

最佳做法是将环境变量的设置放在名为<的文件中bin文件夹中code> setenv.sh / .bat

Best practice is to put the setting of environment variables in a file named setenv.sh/.bat in the bin folder.

catalina.sh 脚本具有调用此脚本的逻辑(如果存在)。

The catalina.sh script has logic to call into this script, if it exists.

之所以如此建议是因为它使您的安装所需的环境变量设置为可移植:您可以轻松地将 setenv.sh 复制到其他Tomcat安装,您可以将Tomcat升级到更新版本(这可能会覆盖 catalina.sh )但仍然有你现有的 setenv.sh

The reason why this is recommended is because it makes setting of environment variables needed for your installation portable: you can easily copy setenv.sh to other Tomcat installations, you can upgrade Tomcat to a newer version (which might overwrite catalina.sh) but still have your existing setenv.sh.

如何在 setenv.sh 中设置堆大小的示例:

An example on how to set the heap size inside setenv.sh:

export JAVA_OPTS='-Xmx784M` 

这篇关于Tomcat 6堆大小 - 这是正确的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆