Explore Courses Blog Tutorials Interview Questions
0 votes
in Java by (7k points)

I am coding for a web application with a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. It is throwing the following error

java.lang.OutOfMemoryError: PermGen space

Apparently, this can occur after redeploying an application a few times. 

1 Answer

0 votes
by (13.1k points)

You have to add these flags to the 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

Want to learn Java? Check out the core Java certification from Intellipaat.

Related questions

Browse Categories