12

i'm getting the following error "http-9000-5" java.lang.OutOfMemoryError: PermGen space

org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError: PermGen space.

My application using axis2.I increased the heap size 1024mb.But its not working.What would be the problem.Solution please

1

5 Answers 5

16

PermGen and heap size are different from each other.

You need to increase permgen space like this:

-XX:PermSize=256m 
-XX:MaxPermSize=256m

add this flags.

Also look at this: explaining-java-lang-outofmemoryerror-permgen-space and this: how-to-deal-with-java-lang-outofmemoryerror-permgen-space-error

Hope this helps.

Sign up to request clarification or add additional context in comments.

1 Comment

These options are explained a bit here: oracle.com/technetwork/java/javase/tech/…
15

you need to set something in your tomcat argument

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 
-server -Xms1536m -Xmx1536m
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m 
-XX:MaxPermSize=256m -XX:+DisableExplicitGC"

Note:XX:MaxPermSize=256m

1 Comment

Remember to put this in a setenv script in your tomcat/bin/ directory. For *nix use a setenv.sh script with export JAVA_OPTS="......" and for Windows use a setenv.bat script with set JAVA_OPTS=......
6

If you're using Tomcat as a Server of Eclipse, go to Server view, then double click on Tomcat, then "Open Launch Configuration", go to Arguments tab, and after setting -Dcatalina.base="" put this

-Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:PermSize=128m

Comments

2

In addition to raising the PermGen size, try enabling permgen garbage collection with

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

Comments

0

Try increasing the ram allocation for your JVM. It should help.

Fix for eclipse: You can configure this in eclipse preference as follows

Windows -> Preferences ( on mac its: eclipse ->preferences) Java -> Installed JREs Select the JRE and click on Edit on the default VM arguments field type in --Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:PermSize=128m. (or your memory preference,for 1 gb of ram its 1024) Click on finish or OK.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.