Dealing with “java.lang.OutOfMemoryError: PermGen space” error
问题 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