如何在不使用配置程序的情况下调整 Tomcat 5.5 JVM 内存设置 [英] How to tune Tomcat 5.5 JVM Memory settings without using the configuration program

查看:26
本文介绍了如何在不使用配置程序的情况下调整 Tomcat 5.5 JVM 内存设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在更大的安装过程中配置 Tomcat 内存设置,所以事后手动配置 tomcat 与配置应用程序是不可能的.我以为我可以将 JVM 内存设置放入 JAVA_OPTS 环境变量中,但我正在使用 jconsole 测试它是否有效,但它......没有.

I need to configure Tomcat memory settings as part of a larger installation, so manually configuring tomcat with the configuration app after the fact is out of the question. I thought I could just throw the JVM memory settings into the JAVA_OPTS environment variable, but I'm testing that with jconsole to see if it works and it... doesn't.

根据下面的评论,CATALINA_OPTS 也不起作用.到目前为止,我让它工作的唯一方法是通过 Tomcat 配置 GUI,这不是我的问题可接受的解决方案.

As per the comment below, CATALINA_OPTS doesn't work either. So far, the only way I can get it to work is via the Tomcat configuration GUI, and that's not an acceptable solution for my problem.

推荐答案

Serhii 的建议有效,这里有更多细节.

Serhii's suggestion works and here is some more detail.

如果您查看安装的 bin 目录,您将看到 catalina.sh或 .bat 脚本.如果您查看这些,您将看到它们运行setenv.sh 或 setenv.bat 脚本(如果存在)分别设置环境变量.相关的环境变量在注释中描述catalina.sh/bat 的顶部.例如,要使用它们创建一个文件$CATALINA_HOME/bin/setenv.sh 包含内容

If you look in your installation's bin directory you will see catalina.sh or .bat scripts. If you look in these you will see that they run a setenv.sh or setenv.bat script respectively, if it exists, to set environment variables. The relevant environment variables are described in the comments at the top of catalina.sh/bat. To use them create, for example, a file $CATALINA_HOME/bin/setenv.sh with contents

export JAVA_OPTS="-server -Xmx512m"

对于 Windows,您将需要在 setenv.bat 中,例如

For Windows you will need, in setenv.bat, something like

set JAVA_OPTS=-server -Xmx768m

希望这有帮助,格伦

这篇关于如何在不使用配置程序的情况下调整 Tomcat 5.5 JVM 内存设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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