Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase permgen space

I am working with tomcat 6.0, and while I am indexing (not while i am starting tomcat), I have a permgen space error.
How could I increase that space??

Thanks

like image 794
Blanca Avatar asked Jun 09 '10 07:06

Blanca


People also ask

How do I increase my PermGen space?

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.

How do I increase PermGen space in Weblogic?

To set PermGen size you can use e.g. -XX:PermSize=512m -XX:MaxPermSize=512m . Regarding Weblogic, set the JAVA_OPTIONS and see if these options are properly passed in as parameters into your Java process. You can also directly set these parameters in the startWeblogic.

What causes PermGen space error?

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.


1 Answers

You can use :

-XX:MaxPermSize=128m 

to increase the space. But this usually only postpones the inevitable.

You can also enable the PermGen to be garbage collected

-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled 

Usually this occurs when doing lots of redeploys. I am surprised you have it using something like indexing. Use virtualvm or jconsole to monitor the Perm gen space and check it levels off after warming up the indexing.

Maybe you should consider changing to another JVM like the IBM JVM. It does not have a Permanent Generation and is immune to this issue.

like image 116
Peter Tillemans Avatar answered Sep 29 '22 19:09

Peter Tillemans