Home > DeveloperSection > Forums > Dealing with “java.lang.OutOfMemoryError: PermGen space” error
Jayden Bell
Jayden Bell

Total Post:105

Posted on    May-07-2015 1:53 AM

 Java Java 

 1 Reply(s)
 458  View(s)
Rate this:
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.

Mayank Tripathi
Mayank Tripathi

Total Post:397

Posted on    May-07-2015 7:27 AM

The solution was to add these flags to JVM command line when Tomcat is started:

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
You can do that by shutting down the tomcat service, then going into the Tomcat/bin directory and running tomcat6w.exe. Under the "Java" tab, add the arguments to the "Java Options" box. Click "OK" and then restart the service.

If you get an error the specified service does not exist as an installed service you should run:

tomcat6w //ES//servicename
where servicename is the name of the server as viewed in services.msc

Don't want to miss updates? Please click the below button!

Follow MindStick