WAR文件给了我内存不足的错误

时间:2013-05-23 06:03:01

标签: java tomcat tomcat6

我正在使用tomcat 6,我部署的WAR文件给了我内存不足的错误。我已经使用Windows安装程序安装了tomcat6因为它我无法在catalina.bat文件夹中找到任何tomcat6.0\bin,我可以在其中配置CATALINA_OPTS变量。

2 个答案:

答案 0 :(得分:0)

如果在tomcat安装中设置CATALINA_OPTS时遇到问题,可以在windows中将其设置为环境变量。

<强>更新

如果上一个方法不起作用,那么你可以在tomcat的bin目录中创建一个setenv.bat文件。

在该文件中,您可以输入以下参数:

 set CATALINA_OPTS= "JVM Conditions here"

这对我有用,试一试。

很少有链接供您参考:

http://www.oracle-base.com/articles/misc/apache-tomcat-7-installation-on-windows.php

How to tune Tomcat 5.5 JVM Memory settings without using the configuration program

答案 1 :(得分:0)

如果您无法找到catalina.bat,请编辑您的tomcat6w.exe并添加

-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:+UseConcMarkSweepGC
-XX:PermSize=128m
-XX:MaxPermSize=512m 
  

您应该更改服务器上的“Xms”和“PermSize”值   能力。

完成编辑后,只需重新启动Tomcat。

希望它有所帮助!