Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB3 Timer -- out of memory issue

Jinu Vijay
Posts: 20
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

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?

2. Solution?
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.

Any other suggestions ... ???
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic