Tomcat: OutOfMemoryError Permgen Space

元气小坏坏 提交于 2019-12-10 00:06:36

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/15487702/tomcat-outofmemoryerror-permgen-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!