简体   繁体   English

在Tomcat上使用Jenkins重新部署Grails应用程序会填充PermGen空间

[英]Redeploying a Grails App using Jenkins on Tomcat fills PermGen Space

Currently we are having various problems with the deployment of our Grails application on Tomcat 6, mainly it's about memory usage issues and redeployment via Jenkins. 当前,在Tomcat 6上部署Grails应用程序时遇到各种问题,主要是关于内存使用问题和通过Jenkins进行重新部署。

The Application eats more and more memory, and we tried to resolve this with CMSPermGenSweepingEnabled (we are using UseConcMarkSweepGC), so now the temporary classes used by Groovy should get cleaned up. 该应用程序消耗越来越多的内存,并且我们尝试使用CMSPermGenSweepingEnabled(我们正在使用UseConcMarkSweepGC)来解决此问题,因此现在应该清除Groovy使用的临时类。

What still is a problem is that on each Redeploy (with jenkins) the app needs around 150 mb of additional Permgen space ... any idea how to avoid this? 仍然存在的问题是,在每个重新部署(使用jenkins)的应用程序中,该应用程序需要大约150 mb的额外Permgen空间……您知道如何避免这种情况吗?

We are using Grail 1.3.7, and our current configuration flags are 我们正在使用Grail 1.3.7,我们当前的配置标志是

-Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties
-Djava.awt.headless=true
-Xms2048M
-Xmx2048M
-XX:MaxPermSize=1024m
-XX:PermSize=1024m
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:+UseConcMarkSweepGC
-Djava.net.preferIPv4Stack=true
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.endorsed.dirs=/usr/share/tomcat6/endorsed
-Dcatalina.base=/var/lib/tomcat6
-Dcatalina.home=/usr/share/tomcat6
-Djava.io.tmpdir=/tmp/tomcat6-tmp

It's very popular tomcat issue , they even have some recommendations: http://wiki.apache.org/tomcat/OutOfMemory , but at most cases it's works only for small or fully controlled project (mean 'project without any external library'). 这是非常受欢迎的tomcat问题 ,他们甚至提出了一些建议: http : //wiki.apache.org/tomcat/OutOfMemory ,但是在大多数情况下,它仅适用于小型或完全受控的项目(意味着“没有任何外部库的项目”)。 All solid projects I ever seen fails under tomcat with this error :( 我见过的所有可靠项目都在tomcat下失败,出现此错误:(

My recomendation - restart Tomcat instance after deploy. 我的建议-部署后重新启动Tomcat实例。

We've experienced similar issues with our Grails applications on Tomcat. 我们在Tomcat上的Grails应用程序遇到了类似的问题。 Our solution is the same as what Igor suggests, restart Tomcat after a deploy. 我们的解决方案与Igor建议的解决方案相同,请在部署后重新启动Tomcat。

We have two production servers setup in a cluster so they share sessions. 我们在群集中设置了两个生产服务器,因此它们共享会话。 We take one server down, undeploy the application, restart tomcat, deploy the new version of the application, and bring that server back up. 我们关闭一台服务器,取消部署应用程序,重新启动tomcat,部署新版本的应用程序,然后重新启动该服务器。 Then repeat the process on the other server. 然后在另一台服务器上重复该过程。 So far this is working for us. 到目前为止,这对我们有用。

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

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