重复的“PermGen”在Tomcat 6 [英] Recurring "PermGen" in Tomcat 6

查看:81
本文介绍了重复的“PermGen”在Tomcat 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Tomcat 6服务器上出现PermGen错误。

I keep getting a "PermGen" error on my Tomcat 6 server.

我知道应用程序导致了什么问题,但我不确定它为什么会这样做。该应用程序使用MySQL 5并在JDK 6上运行。

I know what application is causing the problem, but I am not sure why it is doing so. The application is using MySQL 5 and running on JDK 6.

是否有任何工具/建议可用于诊断或分析特定应用程序的基础问题?

Are there any tools/suggestions to diagnosis or analyze the underlying issue(s) with the specific application?

谢谢

推荐答案

PermGen用于存储类定义和实习字符串池。您的代码可以填充它(如果它不必要地调用实习生),但更可能是您的应用程序的默认值不足。

The PermGen is used to store class definitions and the interned string pool. Your code could be filling it (if it calls intern needlessly), but more likely is that the default is undersized for your application.

这是因为Tomcat将在每次部署WAR时加载新类 - 或者,如果您在开发环境中工作,则每次编辑JSP时都会加载。这些应该最终得到清理,但在活动的开发环境中,您可以拥有加载旧实例和新实例的时间段。或者,如果您在生产环境中并拥有大型网络应用程序,则可能只需要更多空间。

This is because Tomcat will load new classes every time you deploy a WAR -- or, if you are working in a development environment, every time you edit a JSP. Those should eventually get cleaned up, but in an active development environment you can have periods where there are both old and new instances loaded. Or, if you're in a production environment and have a large web-app, you might simply need more space.

要设置permgen大小,请使用 -XX:MaxPermSize = SIZE

To set the permgen size, use -XX:MaxPermSize=SIZE

以下链接可能会对您有所帮助:调整GC (这是1.5版), GC FAQ (1.4.2版), Hotspot VM选项(我相信这是1.6)

The following links may be helpful: tuning GC (this is the 1.5 edition), GC FAQ (1.4.2 edition), Hotspot VM options (I believe this is 1.6)

这篇关于重复的“PermGen”在Tomcat 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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