I have a J2EE application running on Jboss 4.3. A retry functionality to re-send failed request is designed using EJB3 timers.
Problem description Consider 'retryCount' represents the current retry attempt and 'retryinterval' is the time before next retry. These are calculated based on the following logic:
This retryInterval is used to intiate a timertask so that on expiration, the process is attempted again. If the process fails, the retryCount is incremented and the the retryInterval is recalculated and process repeated.
This application is seen to face Out of Memory issue when under load i.e. processing messages in excess of 3000. The only workaround is to restart the server which is impacting SLAs.
Query 2 questions here:
1. Why the problem?
I believe the problem is due to the ejb worker threads being occupied in the sleep mode for this huge intervals (>2 hours!!!). This doesn't leave much scope for any other process to run hence causing OOM issues. Is this correct understanding?
A solution i could think ... implementing standalone batch job that is scheduled to process persisted requests. At least the jvm dies down instead of hogging memory.