Intellij/Grails开发要设置什么才能避免PermGen错误?
我正在使用 IntelliJ 开发 Grails 应用程序,但随着我们的应用程序的增长,我在使用 Tomcat 插件时遇到了 Permgen 错误。我已经尝试了几种设置 permgen size 的组合,但它们似乎没有任何效果。
有什么解决方案可以处理这些 Permgen 错误吗?
i am using IntelliJ to develop Grails application but as our application grows i am hitting the Permgen errors when using the Tomcat plugin. I have tried several combination in settings permgen size but they seem not to have any effect.
Any solution in dealing with these Permgen errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在“运行”菜单中,选择“编辑配置”,选择为 Grails 应用程序执行 run-app 的配置,然后输入 permgen 的值,如下图红色所示。
In the Run menu, select Edit Configurations, choose the configuration that executes run-app for your Grails app, then enter a value for permgen as shown in red below.
您的意思是在重新部署几次后出现永久生成错误吗?
如果是的话,这是Tomcat本身的缺陷。解决这个问题的唯一方法是关闭 Tomcat,重新启动它以清空 perm gen,然后重试。
Grails 本身就造成了这个问题,因为它使用反射来帮助实施“约定优于编码”。反射使用 perm gen 来完成其工作。 Hibernate 也可以做出贡献;请参阅
http://www.jroller.com/agileanswers/entry/preventing_java_s_java_lang
如果您附加VisualVM 1.3.2 到 Tomcat 进程,您将能够看到所有内存、线程等。也许这会帮助您更好地理解其他内容正在发生。
Do you mean that you get perm gen errors after redeploying several times?
If yes, this is a flaw with Tomcat itself. The only way to fix it is to shut down Tomcat, restart it to empty out perm gen, and try again.
Grails itself contributes to the problem by using reflection to help enforce "convention over coding." Reflection uses perm gen to do its work. Hibernate can contribute as well; see
http://www.jroller.com/agileanswers/entry/preventing_java_s_java_lang
If you attach VisualVM 1.3.2 to the Tomcat process you'll be able to see all of memory, threads, etc. Maybe that'll help you understand better if something else is happening.