Grails/Groovy 内存泄漏故障排除? [英] Troubleshooting Grails/Groovy memory leaks?

查看:26
本文介绍了Grails/Groovy 内存泄漏故障排除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Grails 应用程序,它执行了相当数量的域对象创建和销毁,而且它似乎以非常非常快的速度耗尽了永久代空间.我做了通常的调整(将 PermGen 提高到 256M,启用类 GC 等),但没有骰子.

I've got a Grails application that does a fairly decent amount of domain object creation and destruction, and it seems to run out of PermGen space at a very, very rapid rate. I've done the usual tweaks (bumped PermGen to 256M, enabled class GC, etc.), but no dice.

有人愿意推荐一些(希望是免费或非常低成本的)工具来解决 Groovy 和/或 Java 中的此类内存消耗问题吗?或者您用来解决 JVM 内存问题的一些技术?

Would anyone care to recommend some (and hopefully free or very low-cost) tools for troubleshooting this sort of memory consumption in Groovy and/or Java? Or some techniques that you use to troubleshoot JVM memory problems?

Edit:这是在生产模式下将应用程序部署在 Tomcat 内部时;我没有尝试过其他容器.即便如此,如果有一些资源来追踪问题就好了.

This is when the application is deployed inside Tomcat in production mode; I've not tried with other containers. Even so, it would be nice to have some resources for tracking down the problem.

推荐答案

你试过了吗

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

?

连同增加常见的嫌疑人(-Xmx-Xms-XX:PermSize-XX:MaxPermSize) 这解决了我们生产 Tomcat 上的所有 PermGen 问题,这些问题在部署应用程序后很快就发生了.在那之后再也没有见过另一个 OOM 异常.:-)

Together with increasing the usual suspects (-Xmx, -Xms, -XX:PermSize and -XX:MaxPermSize) this resolved all the PermGen issues on our production Tomcat, which had occured pretty soon after deploying the app. Never seen another OOM-Exception after that. :-)

这篇关于Grails/Groovy 内存泄漏故障排除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆