Tomcat:OutOfMemoryError Permgen Space [英] Tomcat: OutOfMemoryError Permgen Space

查看:150
本文介绍了Tomcat:OutOfMemoryError Permgen Space的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Tomcat 6开发JSP应用程序。



由于我确实将Quartz Scheduler Framework和Log4J库添加到项目中,因此Tomcat在重新部署时会开始抛出此异常。 / p>

我已经解决了问题原因,现在我知道必须使用类加载器。



所以,我想问题可能是由自动加载某些类的记录器库造成的。



我该如何处理这个问题?
有另一种方法可以在不使用log4j.properties文件的情况下设置记录器,以确保类加载器能够正常工作。

解决方案

一种方法是通过在下面添加以下JVM参数来增加permgen空间

  -XX:MaxPermSize = 256m 

但它只会延迟OOM错误。如果你一次又一次地重新部署,你将再次遇到permgen内存不足。本文非常清楚地解释了这个原因,我在此不再赘述。 http://frankkieviet.blogspot.com/2006/10 /classloader-leaks-dreaded-permgen-space.html 。抱歉,我没有不同的方法来设置记录器以避免此问题。在实践中,我总是增加MaxPermSize,然后在部署之前循环服务器。


I am developing a JSP application using Tomcat 6.

Since I did add Quartz Scheduler Framework and Log4J library to project, Tomcat start throwing this exception when redeploying.

I have readed about the problem causes, and now I know that have to be with the class loader.

So, I guess the problem can be caused by the logger library that load some classes automatically.

How can I deal with this problem? There is alternative way to setup the logger without using the log4j.properties file to ensure that classloader will work correctly.

解决方案

One way is to increase your permgen space by adding the following JVM arguments to below

-XX:MaxPermSize=256m

But it will only delay the OOM error. If you do redeployment again and again, you will run into the permgen out of memory again. The reason is explained very clearly in this article, which I won't repeat here. http://frankkieviet.blogspot.com/2006/10/classloader-leaks-dreaded-permgen-space.html. Sorry I do not have a different way to setup the logger differently to avoid this issue. In practice, I always increase the MaxPermSize and then cycle server before deployment.

这篇关于Tomcat:OutOfMemoryError Permgen Space的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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