mannuk
mannuk

Reputation: 1269

OUtOfMemoryError: define PermGen space properly in Tomcat 7 and Linux

We have a Tomcat7 instance which deploys 2 web apps. These webapps has a lot of dependencies and the currently memory space seems not to be enough.

We have configured in a startup file the environment variables needed. In particular, we set JAVA_OPTS=-Xmx8192

I talked to my mates about the lack of more config parameters because in another configs I saw -Xms, MaxPermSize,.. etc

Which parameters are missing in order to avoid the PermGen exception and which is their role?

Thanks in advance

Upvotes: 0

Views: 399

Answers (2)

Ivo
Ivo

Reputation: 444

The amount of memory given to Java process is specified at startup. To make things more complex, the memory is divided into separate areas, heap and permgen being the most familiar sub-areas.

While you specify the maximum size of the heap allowed for this particular process via -Xmx, the corresponding parameter for permgen is -XX:MaxPermSize. 90% of the Java apps seem to require between 64 and 512 MB of permgen to work properly. In order to find your limits, experiment a bit.

Upvotes: 1

Nirav Prajapati
Nirav Prajapati

Reputation: 3005

-Xms256m -Xmx1024m -XX:+DisableExplicitGC -Dcom.sun.management.jmxremote
-XX:PermSize=256m -XX:MaxPermSize=512m

add above line of code in your VM arguments i am sure its work for you

if you use eclipse IDE than with use of it you can change the VM argument

double click on the server > open Lunch Configuration > Arguments > VM Arguments

and add above two lines

Upvotes: 1

Related Questions