[jboss-user] [Messaging, JMS & JBossMQ] - Re: Memory leak caused by Connection$PingTask

y-komori do-not-reply at jboss.com
Fri Feb 9 06:46:31 EST 2007

I have the same problem on JBoss 3.2.7.
I think the cause is as follows.

1. The "Connection Monitor Thread" which executes the PingTask can't 
   aquire the semaphore then that thread waits for ever.

2. The "Connection Monitor Thread" is the only thread in the process. 
   PingTasks created by the other Connections will be held in the memory,
   therefore it causes to the memory leak.

3. The Semaphore is locked for ever in the Connection.close().

4. When both PingTask.run() and Connection.close() are executed at the
   same time, the problem will sometimes happen.

For reproducing the problem, breaking at "pingTaskSemaphore.acquir()" in
the PingTask.run() using the debugger, then executing Connection.close().

For avoiding the memory leak problem, I think the following treatment 
is  effective.

1. Change the following line in the PingTask.run().
  before : pingTaskSemaphore.acquire()
  after  : pingTaskSemaphore.attempt(msec)

2. When the "Connection Monitor Thread" failed to aquire the Semaphore,
   it skips the PingTask.

 I'll be preased if some of JBossMQ's commiter will check that this 
 problem is JBossMQ's bug and discuss about my treatment?

Thank you.

Yusuke KOMORI / SMG Co.,Ltd.
komori at smg.co.jp

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013580#4013580

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013580

More information about the jboss-user mailing list