RE: Memory leak in nist implementation
Francisco Javier Tellez Vaquero <[email protected]> Thu, 3 Jul 2008 10:58:41 +0200
| Newsgroups | gmane.comp.voip.nist-sip |
|---|---|
| Message-ID | <[email protected]> |
--===============0331377478391258060==
Content-Type: multipart/alternative;
boundary="_b38ca645-0685-4a8e-a6f3-b3ce2c4ecd7a_"
--_b38ca645-0685-4a8e-a6f3-b3ce2c4ecd7a_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Hi Ranga, Jeroen,
if the application closes those transactions not closed by end points, it s=
eems no memory leak occurs (for example sending 200 response to BYE request=
or sending missing ACK).
But I have another question:
If you don't receive ACK from UAC, in rfc3261 section 13 you find:
If the server retransmits the 2xx response for 64*T1 seconds without
receiving an ACK, the dialog is confirmed, but the session SHOULD be
terminated. This is accomplished with a BYE, as described in Section
15.
The question is that if you try to send a BYE after receiving transaction t=
imeout you obtain this exception creating the request:
javax.sip.SipException: Dialog not yet established -- no response!
at gov.nist.javax.sip.stack.SIPDialog.createRequest(SIPDialog.java:=
1404)
Best Regards,
Fran.
> Date: Mon, 30 Jun 2008 15:58:08 -0400
> From: [email protected]
> To: [email protected]
> Subject: Re: [nist-sip] Memory leak in nist implementation
> CC: [email protected]; [email protected]
>=20
> On Mon, Jun 30, 2008 at 3:10 PM, Francisco Javier Tellez Vaquero
> <[email protected]> wrote:
> > Hello Jeroen,
> > it's the solution we have implemented at UAS side. But the problem is a=
t the
> > other side, you send a BYE request but you don't receive response.
> >
> > We have tried executing 'terminate()' method at transaction level,
> > 'delete()' at dialog level, but without any result.
> >
> > We see similar problem when ACK is not received.
> >
> > Best Regards,
> > Fran.
> >
>=20
> Francisco,
>=20
> Use a memory leak checker and make sure there is no reference in your
> application to those objects that do not get garbage collected. If so
> then there's nothing the stack can do about it.
>=20
> If you still think there's a problem, write a very simple test case
> that illustrates the problem and submit a bug report and we can test
> things out with your test case. You should be able to reproduce this
> problem with a very simple UAS/UAC pair.
>=20
> Thanks
>=20
> >
> >> Date: Mon, 30 Jun 2008 21:00:57 +0200
> >> From: [email protected]
> >> To: [email protected]
> >> CC: [email protected]; [email protected]
> >> Subject: Re: [nist-sip] Memory leak in nist implementation
> >>
> >> Francisco,
> >>
> >> A B2BUA application connects 2 Dialog objects together, one on the "UA=
S"
> >> side (receiving a request) and one on the "UAC" side (forwarding the
> >> request)
> >> Could it be that you are referring to the "UAS" Dialog that is never
> >> destroyed?
> >>
> >> From that Dialog's perspective, your application received the BYE but
> >> never sent a 200 OK. That's different from sending out a BYE onto the
> >> network, and not receiving a 200 OK.
> >>
> >> The proper solution would be to implement logic in the BYE
> >> ClientTransaction timeout handler, to still send a 200 OK for the BYE =
on
> >> the "UAS" side. Alternatively, you can always immediately send 200 OK
> >> when you receive a BYE, and generate a BYE for the second Dialog at th=
e
> >> same time.
> >>
> >> Regards,
> >> Jeroen
> >>
> >> Francisco Javier Tellez Vaquero wrote:
> >> > Hi again,
> >> > we have an application running as a B2BUA.
> >> >
> >> > If we receive a BYE from an end point, we send the BYE to the other
> >> > point. When we receive 200 response, we re-transmit it.
> >> >
> >> > We see sometimes this response is lost (because of network problems,
> >> > because of terminal, ...). The question is the dialog is never
> >> > destroyed until application is re-started. We have wait for garbage
> >> > collection (application is running for days).
> >> >
> >> > Regards.
> >> >
> >> >
> >> > > Date: Mon, 30 Jun 2008 14:39:30 -0400
> >> > > From: [email protected]
> >> > > To: [email protected]
> >> > > Subject: Re: [nist-sip] Memory leak in nist implementation
> >> > > CC: [email protected]
> >> > >
> >> > > When the tx times out delete the dialog and then you have to wait =
for
> >> > > the garbage collection to run before you check for leak.
> >> > >
> >> > > Ranga.
> >> > >
> >> > > On Mon, Jun 30, 2008 at 2:32 PM, Francisco Javier Tellez Vaquero
> >> > > <[email protected]> wrote:
> >> > > > Hi Ranga,
> >> > > > I agree the example case is a listener bug, but think the opposi=
te
> >> > case:
> >> > > >
> >> > > > - You send a BYE request but no response is received.
> >> > > >
> >> > > > You have no control about this point, so the idea is trying to
> >> > close the
> >> > > > dialog anyway.
> >> > > >
> >> > > > BR.
> >> > > >
> >> > > >
> >> > > >> Date: Mon, 30 Jun 2008 14:09:05 -0400
> >> > > >> From: [email protected]
> >> > > >> To: [email protected]
> >> > > >> Subject: Re: [nist-sip] Memory leak in nist implementation
> >> > > >> CC: [email protected]
> >> > > >>
> >> > > >> On Mon, Jun 30, 2008 at 1:55 PM, Francisco Javier Tellez Vaquer=
o
> >> > > >> <[email protected]> wrote:
> >> > > >> > Hi all,
> >> > > >> > I see sometimes not all stack objects are destroyed.
> >> > > >> >
> >> > > >> > For example, if you receive BYE request but no 200 response i=
s
> >> > sent,
> >> > > >> > dialog
> >> > > >> > is never closed. There're a lot of different cases (ACK's los=
t,
> >> > ...).
> >> > > >>
> >> > > >> Not sending a 200 OK to a BYE is an application bug. Please fix
> >> > > >> that.
> >> > > >>
> >> > > >> Please post a specific test case (without listener bugs) and I
> >> > can look
> >> > > >> into it.
> >> > > >>
> >> > > >> Ranga
> >> > > >>
> >> > > >> >
> >> > > >> > I have tried to free memory executing 'terminate()' and/or
> >> > 'delete()'
> >> > > >> > methods in both transaction and dialog objects but without an=
y
> >> > result.
> >> > > >> >
> >> > > >> > Is there any way to force to free these objects (timers, dial=
ogs,
> >> > > >> > transactions, ...) ?
> >> > > >> >
> >> > > >> > Regards.
> >> > > >> >
> >> > > >> >
> >> > > >> >
> >> > > >> > ________________________________
> >> > > >> > Tecnolog=EDa, moda, motor, viajes,.suscr=EDbete a nuestros
> >> > boletines para
> >> > > >> > estar
> >> > > >> > siempre a la =FAltima MSN Newsletters
> >> > > >> > _______________________________________________
> >> > > >> > nist-sip mailing list
> >> > > >> > [email protected]
> >> > > >> > http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
> >> > > >> >
> >> > > >> >
> >> > > >>
> >> > > >>
> >> > > >>
> >> > > >> --
> >> > > >> M. Ranganathan
> >> > > >
> >> > > > ________________________________
> >> > > > Sigue los principales acontecimientos deportivos en directo. MSN
> >> > > > Motor
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > M. Ranganathan
> >> >
> >> > --------------------------------------------------------------------=
----
> >> > Sigue al minuto las principales noticias de tu ciudad MSN Deportes
> >> > <http://deportes.es.msn.com/>
> >> > --------------------------------------------------------------------=
----
> >> >
> >> > _______________________________________________
> >> > nist-sip mailing list
> >> > [email protected]
> >> > http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
> >> >
> >
> > ________________________________
> > Tecnolog=EDa, moda, motor, viajes,.suscr=EDbete a nuestros boletines pa=
ra estar
> > siempre a la =FAltima MSN Newsletters
>=20
>=20
>=20
> --=20
> M. Ranganathan
_________________________________________________________________
Tecnolog=EDa, moda, motor, viajes,=85suscr=EDbete a nuestros boletines para=
estar siempre a la =FAltima
http://newsletters.msn.com/hm/maintenanceeses.asp?L=3DES&C=3DES&P=3DWCMaint=
enance&Brand=3DWL&RU=3Dhttp%3a%2f%2fmail.live.com=
--_b38ca645-0685-4a8e-a6f3-b3ce2c4ecd7a_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class=3D'hmmessage'>
Hi Ranga, Jeroen,<br>if the application closes those transactions not close=
d by end points, it seems no memory leak occurs (for example sending 200 re=
sponse to BYE request or sending missing ACK).<br><br>But I have another qu=
estion:<br><br>If you don't receive ACK from UAC, in rfc3261 section 13 you=
find:<br><br><pre>If the server retransmits the 2xx response for 64*T1 sec=
onds without<br> receiving an ACK, the dialog is confirmed, but the sessi=
on SHOULD be<br> terminated. This is accomplished with a BYE, as describ=
ed in Section<br> 15.</pre><br>The question is that if you try to send a =
BYE after receiving transaction timeout you obtain this exception creating =
the request:<br><br>javax.sip.SipException: Dialog not yet established -- n=
o response!<br> at gov.nist.javax=
.sip.stack.SIPDialog.createRequest(SIPDialog.java:1404)<br><br>Best Regards=
,<br>Fran.<br><br><br>> Date: Mon, 30 Jun 2008 15:58:08 -0400<br>> Fr=
om: [email protected]<br>> To: [email protected]<br>> Subject=
: Re: [nist-sip] Memory leak in nist implementation<br>> CC: jbemmel@zon=
net.nl; [email protected]<br>> <br>> On Mon, Jun 30, 2008 at 3:1=
0 PM, Francisco Javier Tellez Vaquero<br>> <[email protected]=
m> wrote:<br>> > Hello Jeroen,<br>> > it's the solution we h=
ave implemented at UAS side. But the problem is at the<br>> > other s=
ide, you send a BYE request but you don't receive response.<br>> ><br=
>> > We have tried executing 'terminate()' method at transaction leve=
l,<br>> > 'delete()' at dialog level, but without any result.<br>>=
><br>> > We see similar problem when ACK is not received.<br>>=
><br>> > Best Regards,<br>> > Fran.<br>> ><br>> <b=
r>> Francisco,<br>> <br>> Use a memory leak checker and make sure =
there is no reference in your<br>> application to those objects that do =
not get garbage collected. If so<br>> then there's nothing the stack can=
do about it.<br>> <br>> If you still think there's a problem, write =
a very simple test case<br>> that illustrates the problem and submit a b=
ug report and we can test<br>> things out with your test case. You shoul=
d be able to reproduce this<br>> problem with a very simple UAS/UAC pair=
.<br>> <br>> Thanks<br>> <br>> ><br>> >> Date: Mon,=
30 Jun 2008 21:00:57 +0200<br>> >> From: [email protected]<br>>=
; >> To: [email protected]<br>> >> CC: mranga@gmail=
.com; [email protected]<br>> >> Subject: Re: [nist-sip] Memor=
y leak in nist implementation<br>> >><br>> >> Francisco,<=
br>> >><br>> >> A B2BUA application connects 2 Dialog obj=
ects together, one on the "UAS"<br>> >> side (receiving a request)=
and one on the "UAC" side (forwarding the<br>> >> request)<br>>=
; >> Could it be that you are referring to the "UAS" Dialog that is n=
ever<br>> >> destroyed?<br>> >><br>> >> From tha=
t Dialog's perspective, your application received the BYE but<br>> >&=
gt; never sent a 200 OK. That's different from sending out a BYE onto the<b=
r>> >> network, and not receiving a 200 OK.<br>> >><br>&g=
t; >> The proper solution would be to implement logic in the BYE<br>&=
gt; >> ClientTransaction timeout handler, to still send a 200 OK for =
the BYE on<br>> >> the "UAS" side. Alternatively, you can always i=
mmediately send 200 OK<br>> >> when you receive a BYE, and generat=
e a BYE for the second Dialog at the<br>> >> same time.<br>> &g=
t;><br>> >> Regards,<br>> >> Jeroen<br>> >><b=
r>> >> Francisco Javier Tellez Vaquero wrote:<br>> >> >=
; Hi again,<br>> >> > we have an application running as a B2BUA=
.<br>> >> ><br>> >> > If we receive a BYE from an e=
nd point, we send the BYE to the other<br>> >> > point. When we=
receive 200 response, we re-transmit it.<br>> >> ><br>> >=
;> > We see sometimes this response is lost (because of network probl=
ems,<br>> >> > because of terminal, ...). The question is the d=
ialog is never<br>> >> > destroyed until application is re-star=
ted. We have wait for garbage<br>> >> > collection (application=
is running for days).<br>> >> ><br>> >> > Regards.=
<br>> >> ><br>> >> ><br>> >> > > Dat=
e: Mon, 30 Jun 2008 14:39:30 -0400<br>> >> > > From: mranga@=
gmail.com<br>> >> > > To: [email protected]<br>>=
>> > > Subject: Re: [nist-sip] Memory leak in nist implementat=
ion<br>> >> > > CC: [email protected]<br>> >> =
> ><br>> >> > > When the tx times out delete the dialo=
g and then you have to wait for<br>> >> > > the garbage coll=
ection to run before you check for leak.<br>> >> > ><br>>=
>> > > Ranga.<br>> >> > ><br>> >> >=
> On Mon, Jun 30, 2008 at 2:32 PM, Francisco Javier Tellez Vaquero<br>&=
gt; >> > > <[email protected]> wrote:<br>> &g=
t;> > > > Hi Ranga,<br>> >> > > > I agree the=
example case is a listener bug, but think the opposite<br>> >> &g=
t; case:<br>> >> > > ><br>> >> > > > - =
You send a BYE request but no response is received.<br>> >> > &=
gt; ><br>> >> > > > You have no control about this poi=
nt, so the idea is trying to<br>> >> > close the<br>> >&g=
t; > > > dialog anyway.<br>> >> > > ><br>> &g=
t;> > > > BR.<br>> >> > > ><br>> >> =
> > ><br>> >> > > >> Date: Mon, 30 Jun 2008 1=
4:09:05 -0400<br>> >> > > >> From: [email protected]<br=
>> >> > > >> To: [email protected]<br>> &g=
t;> > > >> Subject: Re: [nist-sip] Memory leak in nist imple=
mentation<br>> >> > > >> CC: [email protected]<br=
>> >> > > >><br>> >> > > >> On Mo=
n, Jun 30, 2008 at 1:55 PM, Francisco Javier Tellez Vaquero<br>> >>=
; > > >> <[email protected]> wrote:<br>> >=
> > > >> > Hi all,<br>> >> > > >> &g=
t; I see sometimes not all stack objects are destroyed.<br>> >> &g=
t; > >> ><br>> >> > > >> > For example,=
if you receive BYE request but no 200 response is<br>> >> > se=
nt,<br>> >> > > >> > dialog<br>> >> > &=
gt; >> > is never closed. There're a lot of different cases (ACK's=
lost,<br>> >> > ...).<br>> >> > > >><br>&=
gt; >> > > >> Not sending a 200 OK to a BYE is an applica=
tion bug. Please fix<br>> >> > > >> that.<br>> >=
> > > >><br>> >> > > >> Please post a s=
pecific test case (without listener bugs) and I<br>> >> > can l=
ook<br>> >> > > >> into it.<br>> >> > >=
>><br>> >> > > >> Ranga<br>> >> > &=
gt; >><br>> >> > > >> ><br>> >> >=
> >> > I have tried to free memory executing 'terminate()' and=
/or<br>> >> > 'delete()'<br>> >> > > >> &g=
t; methods in both transaction and dialog objects but without any<br>> &=
gt;> > result.<br>> >> > > >> ><br>> >&=
gt; > > >> > Is there any way to force to free these objects=
(timers, dialogs,<br>> >> > > >> > transactions, .=
..) ?<br>> >> > > >> ><br>> >> > > &=
gt;> > Regards.<br>> >> > > >> ><br>> >=
> > > >> ><br>> >> > > >> ><br>&g=
t; >> > > >> > ________________________________<br>>=
; >> > > >> > Tecnolog=EDa, moda, motor, viajes,.suscr=
=EDbete a nuestros<br>> >> > boletines para<br>> >> &g=
t; > >> > estar<br>> >> > > >> > siempr=
e a la =FAltima MSN Newsletters<br>> >> > > >> > __=
_____________________________________________<br>> >> > > &g=
t;> > nist-sip mailing list<br>> >> > > >> > =
[email protected]<br>> >> > > >> > http://www-=
x.antd.nist.gov/mailman/listinfo/nist-sip<br>> >> > > >&g=
t; ><br>> >> > > >> ><br>> >> > >=
>><br>> >> > > >><br>> >> > > &g=
t;><br>> >> > > >> --<br>> >> > > &g=
t;> M. Ranganathan<br>> >> > > ><br>> >> >=
> > ________________________________<br>> >> > > >=
Sigue los principales acontecimientos deportivos en directo. MSN<br>> &=
gt;> > > > Motor<br>> >> > ><br>> >> &g=
t; ><br>> >> > ><br>> >> > > --<br>> &g=
t;> > > M. Ranganathan<br>> >> ><br>> >> >=
------------------------------------------------------------------------<b=
r>> >> > Sigue al minuto las principales noticias de tu ciudad =
MSN Deportes<br>> >> > <http://deportes.es.msn.com/><br>&=
gt; >> > ---------------------------------------------------------=
---------------<br>> >> ><br>> >> > _______________=
________________________________<br>> >> > nist-sip mailing lis=
t<br>> >> > [email protected]<br>> >> > http:/=
/www-x.antd.nist.gov/mailman/listinfo/nist-sip<br>> >> ><br>>=
; ><br>> > ________________________________<br>> > Tecnolog=
=EDa, moda, motor, viajes,.suscr=EDbete a nuestros boletines para estar<br>=
> > siempre a la =FAltima MSN Newsletters<br>> <br>> <br>> <=
br>> -- <br>> M. Ranganathan<br><br /><hr />Sigue al minuto las princ=
ipales noticias de tu ciudad <a href=3D'http://deportes.es.msn.com/' target=
=3D'_new'>MSN Deportes</a></body>
</html>=
--_b38ca645-0685-4a8e-a6f3-b3ce2c4ecd7a_--
--===============0331377478391258060==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
nist-sip mailing list
[email protected]
http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
--===============0331377478391258060==--