Bugs item #890030, was opened at 2004-02-03 22:52 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=890030&group_id=22866
Category: JBossMQ Group: v3.2 Status: Open Resolution: None Priority: 5 Submitted By: Adrian Brock (ejort) Assigned to: Elias Ross (genman) Summary: SimpleTimer is an inefficient use of resources Initial Comment: The class org.jboss.mq.server.SimpleTimer causes two resource problems. 1) The SimpleTimer extends Thread. This means that unless the thread is actually started, its reference in its threadgroup is never cleaned up. This only happens when the thread exits, so not starting the thread causes a memory leak. This also confuses the thread count within the VM which counts the number of Thread objects that haven't exited. It should implement Runnable. 2) We cannot have one thread per queue/topic subscription. It simply will not scale. e.g. if a topic has 100 subscriptions that would mean 100 threads. The implementation needs to be changed to use a thread pool with events as Runnables. A single thread can monitor when the next event is due. See for example the TimerTask in the common project or the RunnableScheduler in the jmx project. The TimerTask seems more appropriate since the events only need to happen once. In my experience, the other option java.util.Timer does not behave efficiently under stress. Regards, Adrian ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=890030&group_id=22866 ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development