Tomcat 7 Spring IntelliJ IDEA 10.5 Application OutOfMemoryError: PermGen Space

Not sure who is responsible for this error:

Exception in thread "main" java.lang.OutOfMemoryError: PermGen space 

This error occurs when I try to launch my spring web application in debug mode from IntelliJ IDEA 10.5 (my project is a maven format project).

When running the same application from a standalone Tomcat 7 web server (put the war in the webapps folder) it works fine. Also from mvn clean install t7: the running application also works fine.

My application is a spring JPA application using Hibernate as a JPA provider, c3p0 is used to pool pools (switches to it with bonecp, it is believed that bonecp is the cause of this error, but it is still reproducible with c3p0), spring TomcatInstrumentationLoading is used to support JPA on Tomcat.

My OS is Debian, Linux.

+6
source share
2 answers

This should be enough to make it work:

-XX: MaxPermSize = 256m

VM options set in Tomcat startup / debug configuration before

-XX:MaxPermSize=256m

+25
source

Set virtual machine arguments to allocate more space for your program

like

 -Xms128m -Xmx8192m -XX:PermSize=128m -XX:MaxPermSize=256m 
+5
source

Source: https://habr.com/ru/post/904738/


All Articles