解决使用 Jetty 7 重新部署时的 PermGen 问题
经过几天的调试,我成功在 Tomcat 6.0.32 上重新部署了一个中型到大型 Web 应用程序,没有任何 PermGen
泄漏。我看到 PermGen 在填满后下降,并且类加载器被垃圾收集。
欣喜若狂后,我尝试在我们的开发环境(由 Maven 和 Jetty 插件组成)上重新部署应用程序而不会出现泄漏。
不幸的是,我似乎遇到了服务器限制,如下面的屏幕截图所示
Yourkit 快照 http: //img811.imageshack.us/img811/7320/jettyclassloaderbeanelr.png
Jetty请求线程对a有强引用BeanElResolver
反过来又对我的 web 应用程序中的多个类具有强引用。
我没有找到有关如何刷新此信息的参考。
如何从我的应用程序中删除最终的
更新:
我已执行以下操作来解决该问题,但没有成功:
- 更新到最新版本的 Jetty 插件(7.4.5 和 8.0.0.M3 )
- 使用了 CMS 收集器:
-XX:+ UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
更新 2:
- 我已将其报告为 Jetty 问题跟踪器上的错误:maven-jetty-plugin:由于 javax.el.BeanELResolver 导致 PermGen 泄漏
After a couple of days of debugging I have managed to have a medium-to-large web application redeploy successfully on Tomcat 6.0.32 without any PermGen
leaks. I saw the PermGen
drop after it filled, and the classloaders were garbage collected.
After much rejoicing I tried to make the application redeploy without leaks on our development environment, which is composed of Maven and the Jetty plugin.
Unfortunately I seem to have hit a server limitation, as illustrated by the below screenshot
Yourkit snapshot http://img811.imageshack.us/img811/7320/jettyclassloaderbeanelr.png
Jetty request threads have a strong reference to a BeanElResolver
which in turns has a strong reference to multiple classes from my webapp.
I have found no reference on how to flush this information.
How can I remove this final PermGen
leak from my application?
Update:
I've done the following to fix the problem, with no luck:
- updated to the Latest version of the Jetty Plugin ( both 7.4.5 and 8.0.0.M3 )
- used the CMS collector :
-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
Update 2:
- I've reported this as a bug on the Jetty issue tracker: maven-jetty-plugin: PermGen leak due to javax.el.BeanELResolver
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是 EL 实现中的一个实际错误,已在最新的 Jetty 版本中解决。
版本 7.5.0 发布后将包含修复程序。
This is a actual bug in the EL implementation which is worked around in the latest Jetty versions.
Version 7.5.0, once released, will contain the fix.
不是您问题的直接答案,但您可以考虑在开发中使用 JRebel 。使用 JRebel,您基本上不必重新部署,从而避免永久生成泄漏和重新部署所浪费的时间。它对我来说非常有效。
Not a direct answer to your question, but you might consider using JRebel in dev. With JRebel, you mostly don't have to redeploy, thus avoiding both the permgen leaks and the wasted time of a redeploy. It's been working extremely well for me.