PermGen space error (Hibernate, JPA)

| No Comments

If you ever come across a PerGen space error in Hibernate or JPA...it refers to the java.lang.outfspacememoryerror (Your webapp is out of memory). PermGen is  used to store the class definations ( and I do mean all the Loaded Classes ). This error refers to the heap space being full due to the large number of classes.

Generally you can recover from these errors by restarting your WebServer. If you want to really fix it, do one of the following 2:

1. Hibernate: Change the hibernate.properties file from  "hibernate.bytecode.provider javassist" to hibernate.bytecode.provider cglib".

2. JPA:  Change the persistance.xml file from
<property name="hibernate.bytecode.provider" value="javaassist"/> to <property name="hibernate.bytecode.provider" value="cglib"/>

Happy Coding :)

Leave a comment

Pages

Categories