permgen

Dealing with “java.lang.OutOfMemoryError: PermGen space” error

烈酒焚心 提交于 2019-11-25 21:46:33
问题 Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It\'s a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. Apparently this can occur after redeploying an application a few times. What causes it and what can be done to avoid it? How do I fix the problem? 回答1: The solution was to add these flags to JVM command line when Tomcat is started: -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled You can do that by

Increase permgen space

谁说胖子不能爱 提交于 2019-11-25 19:21:12
I am working with tomcat 6.0, and while I am indexing (not while i am starting tomcat), I have a permgen space error. How could I increase that space?? Thanks You can use : -XX:MaxPermSize=128m to increase the space. But this usually only postpones the inevitable. You can also enable the PermGen to be garbage collected -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled Usually this occurs when doing lots of redeploys. I am surprised you have it using something like indexing. Use virtualvm or jconsole to monitor the Perm gen space and check it levels off after