如何确保Tomcat6在Windows上读取CATALINA_OPTS? [英] How to make sure that Tomcat6 reads CATALINA_OPTS on Windows?
问题描述
我有一台运行在Windows2003机器上的Tomcat6。
我在这个服务器上部署了2个Grails应用程序,我很快就注意到,在部署后有一段时间,经典的PermGen错误导致所有事情都崩溃了。
java.lang.OutOfMemoryError:PermGen空间
java.lang.ClassLoader.defineClass1(本地方法)
java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
java .lang.ClassLoader.defineClass(ClassLoader.java:616)
org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.de
...
所以我找到了一个解决这个问题的常见问题:增加堆和permgen空间:
set CATALINA_OPTS = - Xms1024m -Xmx1024m -XX:PermSize = 128m -XX:MaxPermSize = 512m
添加到C:\apache-tomcat-6.0.26\bin\catalina.bat。
不幸的是,这不起作用,但问题是我不确定Tomcat是否正在使用它。我检查了各种日志,但这些选项从未打印出来。
是否有方法记录它们并确保Tomcat已经读取它们?编辑:我试图在tomcat6w.exe中添加以下JVM选项:
编辑:
-XX:+ CMSClassUnloadingEnabled
-XX:+ CMSPermGenSweepingEnabled
-XX:+ UseConcMarkSweepGC
没有任何变化。正常运行时间2-3分钟后,我会得到permGen。
任何其他想法?
干杯!
Mulone
谢谢大家!
我终于解决了这个问题:
-XX:+ CMSClassUnloadingEnabled
-XX:+ CMSPermGenSweepingEnabled
-XX:+ UseConcMarkSweepGC
-XX:PermSize = 128m
-XX:MaxPermSize = 512m
到tomcat6w.exe上的java选项。
谢谢!
I have a Tomcat6 running on a Windows2003 machine. I deployed 2 Grails apps on this server and I soon noticed that everything was crashing sometime after the deploy with a classic PermGen error.
java.lang.OutOfMemoryError: PermGen space
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
java.lang.ClassLoader.defineClass(ClassLoader.java:616)
org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.de
...
So I found a common fix for this problem: increasing heap and permgen space with:
set CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m"
Added into C:\apache-tomcat-6.0.26\bin\catalina.bat. Unfortunately this didn't work, but the problem is that I'm not sure that Tomcat is picking it up. I checked various logs but these options are never printed out. Is there a way to log them and make sure that Tomcat has read them?
EDIT: I tried to add the following JVM options with tomcat6w.exe:
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:+UseConcMarkSweepGC
And nothing changed. I get a permGen after 2-3 minutes of uptime. Any other idea?
Cheers! Mulone
Thank you all! I finally solved the issue by adding:
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:+UseConcMarkSweepGC
-XX:PermSize=128m
-XX:MaxPermSize=512m
To the java options on tomcat6w.exe.
Thanks!
这篇关于如何确保Tomcat6在Windows上读取CATALINA_OPTS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!