java.lang.OutOfMemoryError: PermGen space Issue
Hi All,
We have batch that run for 10 hours contains more than 150 jobs.
Our application registers the job individually and run begins.
once the job is completed,we Unregister the job.
Nearly 85 to 90 jobs got completed the below exception is thrown.
we are trying to increase the Permanent Generation (-XX:MaxPermSize=128m).
But Still i have some doubts.
1. We were not unregistering the job before. Is it a cause for the exception ?
( But, we tried with unregistering too.Then too we ended up in the same exception)
2. Any other way to avoid this error other than increasing the memory?
<code>
ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error executing the step
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at my.application.batch.core.tasklet.BatchExecutor.re cordBatchRunExceptionDetails(BatchExecutor.java:10 30)
at my.application.batch.core.tasklet.BatchExecutor.is JobRegistered(BatchExecutor.java:1003)
at my.application.batch.core.tasklet.BatchExecutor.la unchStepJob(BatchExecutor.java:906)
at my.application.batch.core.tasklet.BatchExecutor.ex ecute(BatchExecutor.java:341)
at org.springframework.batch.core.step.tasklet.Taskle tStep$ChunkTransactionCallback.doInTransaction(Tas kletStep.java:347)
at org.springframework.transaction.support.Transactio nTemplate.execute(TransactionTemplate.java:128)
at org.springframework.batch.core.step.tasklet.Taskle tStep$2.doInChunkContext(TaskletStep.java:261)
at org.springframework.batch.core.scope.context.StepC ontextRepeatCallback.doInIteration(StepContextRepe atCallback.java:76)
at org.springframework.batch.repeat.support.RepeatTem plate.getNextResult(RepeatTemplate.java:367)
at org.springframework.batch.repeat.support.RepeatTem plate.executeInternal(RepeatTemplate.java:214)
at org.springframework.batch.repeat.support.RepeatTem plate.iterate(RepeatTemplate.java:143)
at org.springframework.batch.core.step.tasklet.Taskle tStep.doExecute(TaskletStep.java:247)
at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:196)
at org.springframework.batch.core.job.SimpleStepHandl er.handleStep(SimpleStepHandler.java:115)
at org.springframework.batch.core.job.flow.JobFlowExe cutor.executeStep(JobFlowExecutor.java:61)
at org.springframework.batch.core.job.flow.support.st ate.StepState.handle(StepState.java:60)
at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:144)
at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:99)
at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:281)
</code>
Thanks for your reply in advance.
Thanks & Regards,
Arun Duraisamy