Discussion

OutOfMemory Error - PermGen Space

How to avoid OutOfMemory Error - PermGen Space error?We are using PRPC 5.5 installed over tomcat 6 server.Please provide suggestions.[:)]

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

February 14, 2012 - 12:57am

Increase The MaxPermSize variable until you no longer see the errors.

The parameter for controlling the size of space for loading classes is -XX:MaxPermSize= value

February 14, 2012 - 1:04am

Where i have to specify the parameter -XX:MaxPermSize= value?

February 14, 2012 - 8:03am

(JAVA_OPTS) Look for this in the tomcat home/bin directory or where you start the tomcat instance from. example:
JAVA_OPTS="-Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:NewSize=512m -XX:MaxNewSize=512m ....... "

February 16, 2012 - 12:00am

quote:


Originally posted by ROSSLINFOOT

(JAVA_OPTS) Look for this in the tomcat home/bin directory or where you start the tomcat instance from. example:
JAVA_OPTS="-Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:NewSize=512m -XX:MaxNewSize=512m ....... "

I cant understand..where is this JAVA_OPTS? where i need to specify that?

February 16, 2012 - 12:32am

Hey Buddy,

Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. Look at the file tomcat-install/bin/catalina.sh or catalina.bat for how this variable is used. For example,

set CATALINA_OPTS=”-Xms512m -Xmx512m” (Windows)
JAVA_OPTS="-Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=512m

In catalina.bat or catallina.sh, you may have noticed CATALINA_OPTS, JAVA_OPTS, or both can be used to specify Tomcat JVM options.

What is the difference between CATALINA_OPTS and JAVA_OPTS?
The name CATALINA_OPTS is specific for Tomcat servlet container, whereas JAVA_OPTS may be used by other java applications (e.g., JBoss).

Since environment variables are shared by all applications, we don’t want Tomcat to inadvertently pick up the JVM options intended for other apps. I prefer to use CATALINA_OPTS.

Cheers,
Naren

February 16, 2012 - 2:16am

quote:


Originally posted by POTNURUN

Hey Buddy,

Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. Look at the file tomcat-install/bin/catalina.sh or catalina.bat for how this variable is used. For example,

set CATALINA_OPTS=”-Xms512m -Xmx512m” (Windows)
JAVA_OPTS="-Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=512m

In catalina.bat or catallina.sh, you may have noticed CATALINA_OPTS, JAVA_OPTS, or both can be used to specify Tomcat JVM options.

What is the difference between CATALINA_OPTS and JAVA_OPTS?
The name CATALINA_OPTS is specific for Tomcat servlet container, whereas JAVA_OPTS may be used by other java applications (e.g., JBoss).

Since environment variables are shared by all applications, we don’t want Tomcat to inadvertently pick up the JVM options intended for other apps. I prefer to use CATALINA_OPTS.

Cheers,
Naren


there is no such file catalina.sh or catalina.bat in our bin folder.i am using PRPC 5.5 enterprise edition..is there any other way?

February 17, 2012 - 4:50am

This is all related to tomcat settings, the options and the files mentioned above refer to files in the Tomcat bin directory.

see here: http://tomcat.apache.org/tomcat-6.0-doc/setup.html

February 21, 2012 - 3:50pm

Increase the Perm space may help you if really your configuration is wrong. But If any object retains reference of classloader than its not garbage collected and Perm Gen Space is not freed up.if your thread is still running on a while loop then it can as well.

Monitor the GC log,Look for Thread dump and make sure you are using the proper JDBC drivers.