Opened 15 years ago

Closed 15 years ago

#472 closed defect (fixed)

java.lang.OutOfMemoryError: PermGen space

Reported by: Jari Häkkinen Owned by: Jari Häkkinen
Priority: major Milestone: BASE 2.2
Component: core Version:
Keywords: Cc:

Description (last modified by Jari Häkkinen)

I get java.lang.OutOfMemoryError: PermGen space error when running several BASE application in parallel on one tomcat server.

Change History (5)

comment:1 Changed 15 years ago by Jari Häkkinen

Status: newassigned

comment:2 Changed 15 years ago by Jari Häkkinen

Description: modified (diff)

I am currently looking into these items (found searching the web) for a solution

  • http://wiki.apache.org/tomcat/OutOfMemory
  • Try to add more space for PermGen using -XX:MaxPermSize=256m. However, I think this will only postpone the problem. http://java.sun.com/docs/hotspot/VMOptions.html
  • in cases with different webapps with the same third party libs in the WEB-INF/lib folder it might help if the shared libs are moved to the shared/lib folder. Put only the third party libs there, that are definitely the same for all webapps, for example jdbc-driver and similar things. This helps because otherwise the libs are loaded by different classloaders

comment:3 Changed 15 years ago by Jari Häkkinen

I am now running tomcat with CATALINA_OPTS="-server -Xmx500m -XX:MaxPermSize=256m" That is increasing memory pool for tomcat. The OutOfMemory link above is targeting another memory problem than the one we have here. The third option above is not usable for me (Jari) since I run different version of BASE.

So, lets hope this is stable.

comment:4 Changed 15 years ago by Nicklas Nordborg

The third options is a bit risky if the libraries you move to a shared directory uses singleton classes. You will end up with one instance for the entire Tomcat server instead of one for each web application. If the singleton is used to hold, for example, configuration values (the BASE 2 core contains such classes) these must be the same for all web applications. It could lead to all kinds of strange errors unless you know what you are doing.

comment:5 Changed 15 years ago by Jari Häkkinen

Resolution: fixed
Status: assignedclosed

Increasing the MaxPermSize? solves the problem. Our server is still running since the incease.

Note: See TracTickets for help on using tickets.