简体   繁体   English

在哪里而不是如何在Tomcat 6.0.26中更改虚拟内存

[英]Where, not how, to change virtual memory in Tomcat 6.0.26

I had a batch job fail under Tomcat 6.0.26 last night because of an out of memory exception. 由于内存不足异常,我昨晚在Tomcat 6.0.26下执行了批处理作业失败。

Now I'm running the job again now within NetBeans where I have amended the Java VM settings. 现在,我现在在NetBeans中再次运行了该作业,在那里我修改了Java VM设置。 all appears well. 一切都很好。

But can anyone tell me which configuration file in Tomcat I would have to change to allow the Windows service to run with the new settings? 但是,谁能告诉我必须在Tomcat中更改哪个配置文件以允许Windows服务以新设置运行?

I don't believe that I specify the new VM settings here: 我不相信我在这里指定新的VM设置:

Windows 7 Tomcat服务

I realise this may be a duplicate request but thanks anyway. 我意识到这可能是重复的请求,但还是要感谢。 I should add that Tomcat was not installed using the Windows Service Installer exe file described here: 我应该添加未使用此处描述的Windows Service Installer exe文件安装Tomcat的信息:

How do I increase memory on Tomcat 7 when running as a Windows Service? 作为Windows服务运行时,如何增加Tomcat 7的内存?

Probably a good idea to figure out exact cause for the out of memory error. 找出内存不足错误的确切原因可能是一个好主意。
As most of the time however much increased, it will still go out of memory. 但是随着大多数时间的增加,它仍然会耗尽内存。
That said, 那就是

Uninstall the service. 卸载服务。
Install the service with required values. 使用所需的值安装服务。

C:\tomcat-installation\bin> tomcat6 //IS//Tomcat6 ++JvmOptions="-Xms128m;-Xmx768m" --DisplayName="Apache Tomcat 6"

Check http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html for other options. 检查http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html是否有其他选项。

If service.bat is used for the installation, add required values in the service.bat itself. 如果使用service.bat进行安装,请在service.bat本身中添加所需的值。

"%EXECUTABLE%" //IS//%SERVICE_NAME% ... ++JvmOptions="-Xms128m;-Xmx768m"

Also check https://stackoverflow.com/a/5988466/2208271 which is the actual answer to that particular question, and same can be done in tomcat 6. 还要检查https://stackoverflow.com/a/5988466/2208271 ,这是该特定问题的实际答案,并且可以在tomcat 6中进行此操作。


When tomcat is started as a standalone process using startup.bat / catalina.bat : 当使用startup.bat / catalina.bat将tomcat作为独立进程启动时:

Create (or edit if existing) <tomcat-extracted-dir>\\bin\\setenv.bat and add an entry similar to following with required values. 创建(或编辑,如果存在) <tomcat-extracted-dir>\\bin\\setenv.bat并添加一个类似于以下内容的条目,并带有必需的值。

set "JAVA_OPTS=-Xms128m -Xmx768m -XX:MaxPermSize=256m %JAVA_OPTS%"

If existing, <tomcat-extracted-dir>\\bin\\setenv.bat is used by catalina.bat to load additional configuration. 如果存在,则catalina.bat使用<tomcat-extracted-dir>\\bin\\setenv.bat加载其他配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM