Comment #15 on issue 133 by
frankcaz...@gmail.com: JSR-309 driver leaks
memory
https://code.google.com/p/mediaserver/issues/detail?id=133
Hi,
I'm working with MSS 3.0.0 Final & MMS 3.0.0 Final over JBoss 7 and jdk 7.
Sometimes with heavy traffic appears the following warning:
2015-01-09 08:36:39,294
[org.mobicents.servlet.sip.core.session.SipApplicationSessionImpl.acquire]
[1303] WARN - Failed to acquire session semaphore
java.util.concurrent.Semaphore@2ee80265[Permits = 0] for 30 secs. We will
unlock the semaphore no matter what because the transaction is about to
timeout. THIS MIGHT ALSO BE CONCURRENCY CONTROL RISK. app Session
is1c59e57c-a4f8-4e21-8dd1-c855ccbb2766;Click2CallApplication
At this time, the SIPClientTransactionImpl and SIPServerTransactionImpl
objects starts to grow up to 20000 instances in a day.
Seems that some threads blocks with the following trace (from JConsole):
Stack trace:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
org.mobicents.javax.media.mscontrol.mediagroup.PlayerImpl.play(PlayerImpl.java:208)
org.mobicents.javax.media.mscontrol.mediagroup.PlayerImpl.play(PlayerImpl.java:218)
enel.indexbook.adapter.sip.Click2CallSipServlet.doProvisionalResponse(Click2CallSipServlet.java:414)
javax.servlet.sip.SipServlet.doResponse(SipServlet.java:271)
javax.servlet.sip.SipServlet.service(SipServlet.java:334)
org.mobicents.servlet.sip.core.dispatchers.MessageDispatcher.callServlet(MessageDispatcher.java:458)
org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher$1.dispatch(ResponseDispatcher.java:479)
org.mobicents.servlet.sip.core.dispatchers.DispatchTask.dispatchAndHandleExceptions(DispatchTask.java:61)
org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher.dispatchMessage(ResponseDispatcher.java:512)
org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl.processResponse(SipApplicationDispatcherImpl.java:1005)
gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:296)
gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:185)
gov.nist.javax.sip.DialogFilter.processResponse(DialogFilter.java:1501)
gov.nist.javax.sip.stack.SIPClientTransactionImpl.inviteClientTransaction(SIPClientTransactionImpl.java:889)
gov.nist.javax.sip.stack.SIPClientTransactionImpl.processResponse(SIPClientTransactionImpl.java:532)
- locked gov.nist.javax.sip.stack.SIPClientTransactionImpl@607466db
gov.nist.javax.sip.stack.SIPClientTransactionImpl.processResponse(SIPClientTransactionImpl.java:1604)
gov.nist.javax.sip.stack.UDPMessageChannel.processMessage(UDPMessageChannel.java:603)
gov.nist.javax.sip.stack.UDPMessageChannel.processIncomingDataPacket(UDPMessageChannel.java:512)
gov.nist.javax.sip.stack.UDPMessageChannel.run(UDPMessageChannel.java:317)
java.lang.Thread.run(Thread.java:745)
The snippet of the code is the following (line 414 is the play statement):
MediaGroup mediaGroup = (MediaGroup)
linkedSipSession.getAttribute("MEDIA_GROUP");
try {
Parameters options = mediaGroup.createParameters();
options.put(Player.REPEAT_COUNT, 4);
mediaGroup.getPlayer().play(URI.create("http://" +
System.getProperty("jboss.bind.address", "127.0.0.1")
+ ":8080/IndexBook/ring.wav"), null, options);
} catch (MsControlException e) {
//
Click2CallSipServlet.logger.info("MsControlException: " +
e.getMessage());
e.printStackTrace();
}
The first invite (is a click2call application) is sent from an http servlet
asynchronously with:
((SipSessionsUtilExt)
this.sipSessionsUtil).scheduleAsynchronousWork(sipApplicationSession.getId(),
new SipApplicationSessionAsynchronousWork() { ...
I suppose the problem is within PlayerImpl, perhaps linked with the one
described within this thread.
Have you some ideas about the cause of the problem or if there is a patch
that can be used?
Thanks in advance & Regards