based Tomcat PermGen Space

I'm having some problems with Tomcat. I'm deploying a Grails application and as I were adding new features I got this (sadly well known) error in the stacktrace file:

Caused by: java.lang.OutOfMemoryError: PermGen space
2014-01-13 19:28:35,753 [http-bio-8080-exec-26] ERROR StackTrace  - Full Stack Trace:
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.OutOfMemoryError: PermGen space
    at gsp_liquidaciones_liquidacionDeComplejolist_gsp$_run_closure2.doCall(gsp_liquidaciones_liquidacionDeComplejolist_gsp.groovy:84)
    at gsp_liquidaciones_liquidacionDeComplejolist_gsp.run(gsp_liquidaciones_liquidacionDeComplejolist_gsp.groovy:105)
    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
...

I have an Windows installer-based tomcat installation and I don't have an catalina.bat file also. Googling many pages suggest to modify this file (catalina.bat) or register JAVA_OPTS variable, but nothing works. So, where do I have to specify this parameters?:

SET JAVA_OPTS="-Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC”

I have tried to modify the Java Options through Apache Tomcat 7 Properties window but after the modifications the server can't start.

tomcat java配置选项卡

My computer has 4Gb RAM installed.

Thanks in advance.


For the following system specifications:

  • Windows 7 64-bit
  • 4 GB installed RAM
  • Intel Core i7 processor
  • Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
  • The Tomcat 7 Java properties for an acceptable behavior MIGHT be: tomcat的java配置


    You should have a small windows application 'tomcat6w.exe' or 'tomcat7w.exe' when tomcat was installed as a windows service. When you start this application it has a tab 'Java' where you can set the JVM parameters. For more details see more memory to Tomcat service.

    You need to enter only the parameters which start with -X.


    This work for me in apache-tomcat-8.0.15 , but i think it would be the same for all to tomcat's version.

    I had executed regedit and found this path:

    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTomcat8
    

    And change ImagePath key to:

    C:apache-tomcat-8.0.15bintomcat8.exe //RS//Tomcat8 ++JvmOptions -XX:PermSize=128m -XX:MaxPermSize=512m
    
    链接地址: http://www.djcxy.com/p/54986.html

    上一篇: 错误java.lang.OutOfMemoryError:超出GC开销限制

    下一篇: 基于Tomcat的PermGen空间