I want to add some code:
When I run following job on its own, it is working fine without any heap problems:
Code:
<batch:job id="dwhTgeResponseJob">
...
<batch:step id="importTargetGroupFromFile">
<batch:tasklet>
<batch:chunk reader="multiResourceReaderForTargetGroup"
writer="tgeResponseDatabaseWriter" commit-interval="10000" />
<batch:listeners>
<batch:listener ref="passOffersListener" />
</batch:listeners>
</batch:tasklet>
<batch:next on="FAILED" to="releaseTargetGroupResponseLockFailed" />
<batch:next on="*" to="activateOffers" />
</batch:step>
....
If I define a further job which contains a tasklet which invokes the upper job, I get an OutOfMemoryError in the upper step, because the objects which are used in the upper step are never be removed from heap. I could see that in the generated heap dump.
Here's the outer job which is nesting the upper job via a tasklet:
Code:
<batch:job id="offerActivationJob" restartable="false">
<batch:step id="dwhTgeResponseStep">
<batch:tasklet ref="runDwhResponseTasklet" />
<batch:end on="FAILED"/>
<batch:next on="*" to="keyDbSendOfferStep"/>
</batch:step>
<batch:step id="keyDbSendOfferStep">
<batch:tasklet ref="runKeyDbRequestTasklet" />
</batch:step>
...
Does someone have an idea why this heap problem occurs?
Regards,
miwo