Question

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

Was it helpful?

Solution

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

OTHER TIPS

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.

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

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

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top