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

查看:123
本文介绍了如何在不使用配置程序的情况下调整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 /斌/ 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

希望这会有所帮助,
Glenn

Hope this helps, Glenn

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

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