[jboss-user] [EJB 3.0] - EJB3 Timers: OutOfMemory error when handling large number of
do-not-reply at jboss.com
Mon Apr 6 03:25:45 EDT 2009
I have an MDB that needs to start a timer in some cases when it receives a message. This is implemented in terms of an EJB3 timeout method. However, it seems that JBoss is creating a thread per timer. This is causing OutOfMemory errors because the VM cannot allocate new threads for the timers, eventually resulting in a crash of the server when handling large loads (20000 timers). It is necessary to create the timers, so changing the code to not use timers is not an option.
I've googled around a bit for a a solution to this problem, and came across https://jira.jboss.org/jira/browse/EJBTHREE-1330. This issue does mention a workaround (using StrictMaxPool instead of the standard evergrowing ThreadlocalPool. But my MDBs are already using the StrictMaxPool (15 instances strictMaximum), and this does not seem to help.
I would assume that there is a way to configure the TimerService itself to use a thread pool, but the Jira issue does not specify how this could be done, nor does the documentation.
I would really appreciate it someone could shed some light on this... If there is no way of limiting the threads created by the TimerService, I'll have to change the implementation. But if there is some way of changing this, I would like to know how to do this because it would be the most elegant solution...
Thanks in advance,
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4223548#4223548
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4223548
More information about the jboss-user