WebService agent stops after certain some time with message: java.lang.OutOfMemoryError: PermGen spa

Document ID : KB000088816
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
WebService agent stops after certain some time with message: java.lang.OutOfMemoryError: PermGen spa
Resolution:

Symptoms

Agent goes down after some time.  The last message in the log is something like:


20140623/111031.553 - U2000132 JVM Memory usage: Heap=83.88%, Non-Heap=69.20%

java.lang.OutOfMemoryError: PermGen space

 at java.lang.ClassLoader.defineClass1(Native Method)

 at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

 at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.define(ClassLoaderForClassArtifacts.java:42)

 at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts$1.run(ClassLoaderForClassArtifacts.java:86)

 at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts$1.run(ClassLoaderForClassArtifacts.java:84)

 at java.security.AccessController.doPrivileged(Native Method)

 at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:84)

 at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compilePojoMethod(CallSiteGenerator.java:235)

 at org.codehaus.groovy.reflection.CachedMethod.createPojoMetaMethodSite(CachedMethod.java:257)

 at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createCachedMethodSite(PojoMetaMethodSite.java:158)

 at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createPojoMetaMethodSite(PojoMetaMethodSite.java:147)

 at groovy.lang.MetaClassImpl.createPojoCallSite(MetaClassImpl.java:3003)

 at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:114)

 at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:148)

 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)

 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)

 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)

 at SOAP.runJob(WebService.groovy:3712)

 at com.uc4.extensibility.types.CITAgent.dispatchJob(CITAgent.java:258)

 at com.uc4.ex.cit.CITJob.execute(CITJob.java:185)

 at com.uc4.ex.Job.run(Job.java:468)

 at com.uc4.ex.ThreadPool$RunnableDecorator.run(ThreadPool.java:53)

 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

 at java.util.concurrent.FutureTask.run(FutureTask.java:262)

 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

 at java.lang.Thread.run(Thread.java:744)


Restarting the agent resolves the issue temporarily.


Cause

This is caused by the agent running out of PermSize space.


Resolution

Increase the Permsize by adding the -XX:PermSize and -XX:MaxPermSize flags to the start command for the agent to something like the following

"C:\Program Files\Java\jdk1.6.0_21\bin\java" -XX:PermSize=1024M -XX:MaxPermSize=1024M -Xmx2048M -jar C:\uc4\Agents\rapidautomation\WebService\bin\ucxjcitx.jar