重复出现的“PermGen"在 Tomcat 6 中 [英] Recurring "PermGen" in Tomcat 6

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

问题描述

我的 Tomcat 6 服务器上不断出现PermGen"错误.

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

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

谢谢

解决方案

PermGen 用于存储类定义和内部字符串池.您的代码可能正在填充它(如果它不必要地调用了 intern),但更有可能是您的应用程序的默认值过小.

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

要设置永久代大小,请使用 -XX:MaxPermSize=SIZE

以下链接可能会有所帮助:调整 GC (这是 1.5 版),GC 常见问题(1.4.2版本),Hotspot VM 选项(我相信这是 1.6)

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

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?

Thanks

解决方案

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.

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.

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

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天全站免登陆