Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.OutOfMemoryError: PermGen space

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

like image 713
jayavardhan Avatar asked Jan 28 '11 11:01

jayavardhan


People also ask

How do I fix Java Lang OutOfMemoryError Java heap space?

OutOfMemoryError: Java heap space. 1) An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options "-Xmx512M", this will immediately solve your OutOfMemoryError.

How do you fix a PermGen error?

To fix it, increase the PermGen memory settings by using the following Java VM options. -XX:PermSize<size> - Set initial PermGen Size. -XX:MaxPermSize<size> - Set the maximum PermGen Size. In the next step, we will show you how to set the VM options in Tomcat, under Windows and Linux environment.

What is PermGen space in Java?

lang. OutOfMemoryError: PermGen Space is a runtime error in Java which occurs when the permanent generation (PermGen) area in memory is exhausted. The PermGen area of the Java heap is used to store metadata such as class declarations, methods and object arrays.

How can I increase my PermGen size?

To increase the PermGen memory change the value of the MaxPermSize variable, otherwise change the value of the Xmx variable. There are a lot of answers similar to this around but I found that this was the clearest and simplest phrased, very helpful.


2 Answers

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.

like image 129
Harry Joy Avatar answered Oct 14 '22 07:10

Harry Joy


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

  • Read more
like image 22
jmj Avatar answered Oct 14 '22 06:10

jmj