Yellow Bird Yellow Bird - 1 year ago 60
Java Question

Java - OutOfMemoryError: PermGen space

I'm currently developing a tool allowing me to get statistics from anyware simply by going on a website I also created.

For those who don't know, Birt is a reporting tool, and an eclipse plugin.

My problem is the following :

I installed tomcat on the server hosting my website, and installed the Birt ReportEngine on it, and on my website, I call the online viewer to get my reports.

The problem is that since yesterday, when I launch a report, I have this error :

javax.servlet.ServletException: L'exécution de la servlet a lancé une exception

Caused by :

java.lang.OutOfMemoryError: PermGen space

I don't really know which config file to modify to avoid this error. I found some examples online that tell to modify the eclipse.ini file, but as for mty website, I don't use eclipse, I didn't found any usefull post.

Can someone help me please ?


Answer Source

As said by Thomas, the parameter to set is -XX:MaxPermSize. One way of setting this parameter for Tomcat is to use the CATALINA_OPTS environment variable.

For Windows :

set CATALINA_OPTS=-Xms512m -Xmx512m -XX:MaxPermSize=256m

For Linux (bash) :

export CATALINA_OPTS="-Xms512m -Xmx512m -XX:MaxPermSize=256m"

Check the startup.bat and catalina.bat or and files in your tomcat/bin directory and add the above commands there.

(The Xmx and Xms parameters set the minimum and maximum size for the Java heap - where objects are stored. This is not the problem you have but I included them for the sake of completeness.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download