java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space

Hi All ..we are running with the following configuration.

Solaris Version 5.10

./prtconf

System Configuration: Sun Microsystems sun4v

Memory size: 8184 Megabytes

App Server Version,

Sun Java System Application Server Enterprise Edition 8.1_02 (build b11-fcs)

JVM Options in domain.xml,

<jvm-options>-Xmx512m</jvm-options>

but what Im facing is..say once in two days..when I open my application in the browser it shows..

Server Error

This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log.

and in my server.log it shows..,

WARNING|sun-appserver-ee8.1_02|javax.enterprise.system.container.web|_ThreadID= 17;|WEB3061 : HttpService: Unhandled pipeline exception

java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space

at com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.process(HttpS erviceProcessor.java:251)

at com.sun.enterprise.web.HttpServiceWebContainer.service(HttpServiceWebContainer. java:2071)

Caused by: java.lang.OutOfMemoryError: PermGen space

|#]

after getting this I used to reboot the machine..then It ll be fine for some time.,this happens repeatedly..

and some of the documents says..we need to increase the Xmx..

if it so.,how much I can incerase..we are running sun x-fire t2000

Thanks in Advance,

Ashik

[1569 byte] By [ashik_s] at [2007-11-14]
# 1

Hi there

Maybe you want to increase the PermGen space:

-XX:MaxPermSize=MEMORY

You might also want to give a look at what Permgen space is and how it works because you might have a problem with your application or some classloader might be a bit "broken".

The point that it happens every two days might mean you are not GCing stuff properly and/or your objects are being kept for longer than needed.

Rp

SysHex at 2007-7-7 > top of java,Application & Integration Servers,Application Servers...
# 2
Hi thanks ..Basically Im a Software Developer..I haven't much involved in GC tunning..Can U plz give me some related docs..or else U can help me by explaining things in some more detail.Ashik
ashik_s at 2007-7-7 > top of java,Application & Integration Servers,Application Servers...
# 3

Rebooting the machine is unnecessary; you can just stop and restart the application server.

The PermGen holds Class objects primarily (also interned strings and a few other things); are you doing a lot of deployment/redeployment? Those operations greatly increase the number of classes in use by the app server (because each new deployment is a new set of classes from the app server perspective), and that's the most common cause of this problem. In that case, the only thing to do is increase the PermGen size by including in your jvm-options -XX:MaxPermSize=<something>; I'd try 128m or 256m.

More recent versions of the app server (especially platform edition 9.0) have better handling of the multiple classes involved, so you might want to check them out.

A good reference on GC is http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

-Scott

sdo at 2007-7-7 > top of java,Application & Integration Servers,Application Servers...
# 4

Permgen memory is the memory space used to store permanent objects. The objects that the JVM belives will be necessary throughout the life of the application. Like classes themselves and stuff.

Check this : http://www.thesorensens.org/?p=14

and this : http://wiki.caucho.com/Java.lang.OutOfMemoryError:_PermGen_space

Also, give it a read at this : http://forums.oracle.com/forums/message.jspa?messageID=1268268Although this thread is not with a problem exactly like yours, it should give you some pointers as to what might be happening.

Rp

SysHex at 2007-7-7 > top of java,Application & Integration Servers,Application Servers...
# 5

Hi..many thanks.

I added an entry in my domain.xml as ,hope this be correct :)

<jvm-options>-XX:MaxPermSize=256m</jvm-options>

and increased.,the following from 512 from 1024

<jvm-options>-Xmx1024m</jvm-options>

whether this be enough? ,if I struck ,anywhere again I will get back you.

Ashik

ashik_s at 2007-7-7 > top of java,Application & Integration Servers,Application Servers...
# 6
Hi..so far I havent struck anywhere ..thanksAshik
ashik_s at 2007-7-7 > top of java,Application & Integration Servers,Application Servers...