Software⏱️ 2 min read📅 2026-05-31

How to Fix: Dealing with "java.lang.OutOfMemoryError: PermGen space" error

PermGen space error in Hibernate/JPA + IceFaces/JSF application on Tomcat 6 and JDK 1.6.

Quick Answer: Increase the PermGen size or use a newer JVM version with a larger heap.

The "java.lang.OutOfMemoryError: PermGen space" error occurs when the Java Virtual Machine (JVM) runs out of memory for a specific area called the permanent generation, also known as PermGen space.

Why You Are Getting This Error

  • The PermGen space is used to store metadata such as class definitions, method tables, and other data that does not fit in the heap memory. When this space becomes full, it can lead to an OutOfMemoryError.

Best Solutions to Fix It

Method 1: Increasing PermGen Size

  1. Step 1: Open the Tomcat configuration file (usually located in the conf directory) and add the following line to increase the PermGen size: -Xmx512m -XX:MaxPermSize=512m

Method 2: Using a Larger Heap Size

  1. Step 1: Open the Tomcat configuration file and add the following line to increase the heap size: -Xmx1024m -XX:MaxPermSize=512m

Wrapping Up

By increasing the PermGen size or using a larger heap size, you can prevent the OutOfMemoryError and ensure that your application runs smoothly.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions