stackOverFlow Error due to LS2J

Hello forum,

I used a LotusScript agent that calls java code via LS2J to read MQ series messages. After processing 500 messages ,Agent is giving

LS2J Error: Threw java.lang.StackOverFlowError

I have tried gc().assigned NULL value to string variable after its used,Global declaration of Object as mentioned in forum .Still I am facing same

problem.

Can anybody help in this regard ?