Increase permgen space

Blanca picture Blanca · Jun 9, 2010 · Viewed 128.6k times · Source

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

Answer

Peter Tillemans picture Peter Tillemans · Jun 9, 2010

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.