[jboss-user] [Remoting] - Re: Problem for Timer of BisocketServerInvoker
ron.sigal@jboss.com
do-not-reply at jboss.com
Wed Jun 25 19:53:47 EDT 2008
Well, I've heard of that problem, but I'm not sure it really exists.
1. I've profiled the bisocket code without finding any leak.
2. When java.util.TimerTask.cancel() is called it sets its "state" variable to "CANCELLED". Now, java.util.TimerThread.mainLoop() does this:
| task = queue.getMin();
| synchronized(task.lock) {
| if (task.state == TimerTask.CANCELLED) {
| queue.removeMin();
| continue; // No action required, poll queue again
| }
|
so the first time the cancelled TimerTask gets run, it should be removed from the java.util.Timer's queue.
3. BisocketSocketInvoker will recreate its Timer if the Timer has shut itself down, but the reference to the old Timer would be lost, so the old Timer should get garbage collected eventually.
If I'm wrong about anything here, or if I'm missing something, please let me know.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160712#4160712
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160712
More information about the jboss-user
mailing list