John’s Oracle Experiences

My everyday experiences with Oracle products

Archive for July 1st, 2009

Prevent “java.lang.OutOfMemoryError: PermGen space failure” on Oracle Application Server 10.1.3 web deployments

Posted by John Paul van Helvoort on July 1, 2009

Once in a while a re-deployment of a web-app with jdeveloper caused the OC4J server to hang completely. It usually goes right but once in a while the whole OC4J server hangs and a complete restart of opmn is needed.

Logfiles in $ORACLE_HOME/opmn/logs show the following ;

09/06/26 13:39:20 FINER: RmiTransport$DiscreteMessageIn. Receiving message with 22 bytes
09/06/26 13:39:20 FINER: RmiTransport$DiscreteMessageIn. Received 22 bytes of message
09/06/26 13:39:22 WARNING: DeployerRunnable.run java.lang.OutOfMemoryError: PermGen spaceoracle.oc4j.admin.internal.DeployerException:

java.lang.OutOfMemoryError: PermGen space
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:139)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.OutOfMemoryError: PermGen space

This behaviour can be altered by adding an option to the Start-parameters in as-control.
By adding “-XX:MaxPermSize=256m” and restarting the OC4J container , the problem did not appear anymore when deploying intensively… By default the MaxPermSize size is set small and differs per version but willl cause the container to crash when used intensively in deployment actions.

In addition to this you should also increase the “Maximum heap size” and “Initial heap size”.

Posted in Application Server | 2 Comments »