[OpenSIPStack] FW: Memory Leak in Proxy and Full Mode
Brought to you by:
joegenbaclor
From: Gustavo C. <cur...@ho...> - 2008-05-30 20:14:33
|
Hi Joegen: The memory leak is hard to find. I send the 200 OK repeatedly but the memory leak doesn't appear if i'm debugging with Microsot Visual 2005, but the leak appears if i'm running the OpenSBC like a service. If I comment: void SIPStack::EnqueueTransportWriteEvent( const SIPMessage & message, SIPTransportEvent::Type eventType ) { if( m_IsTerminating ) return; /*SIPMessage * msg = new SIPMessage(message); msg->SetInternalHeader( "TRN-ID", msg->GetTransactionId().AsString()); m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, eventType ) );*/ } there is not leak. But if I modify the code like this: void SIPStack::EnqueueTransportWriteEvent( const SIPMessage & message, SIPTransportEvent::Type eventType ) { if( m_IsTerminating ) return; SIPMessage * msg = new SIPMessage(message); /*msg->SetInternalHeader( "TRN-ID", msg->GetTransactionId().AsString()); m_TransportManager->EnqueueEvent( new SIPTransportEvent( msg, eventType ) );*/ delete msg; } the leak shows up. I don't understand why this happens if I'm deleting the msg. What i said in the last mail about CSeq is not seem to be the reason. Any idea? Thanks for your help. Gustavo From: cur...@ho...Subject: RE: [OpenSIPStack] Memory Leak in Proxy and Full ModeDate: Fri, 30 May 2008 17:04:37 +0200 Hi Joegen: I found that the memory leak is when you create a SIPMessage from other SIPMessage or from a OString and then you delete de message. In the case of the 200 Ok the message is created in: ProxySessionManager::OnOrphanedMessage()SIPUserAgent::TransportWrite()SIPStack::EnqueueTransportWriteEvent(){SIPMessage * msg = new SIPMessage(message); The memory leak is because the CSeq header. If i comment : SIPMessage::SIPMessage(const SIPMessage & msg)SIPMessage & SIPMessage::operator=(const SIPMessage & msg)void SIPMessage::AssignContents(SIPMessage & msg){ /*if( m_CSeq != NULL ) msg.m_CSeq = static_cast<CSeq*>(m_CSeq->Clone());*/} There is no more memory leak. I try to replace: SIPMessage * msg = new SIPMessage(message); ----> SIPMessage * msg = new SIPMessage(message.AsString()); but the memory leak still exist unless i comment: void SIPMessage::Finalize(){ /*if( m_CSeq == NULL ) { m_CSeq = new CSeq( h ); }*/} That's what i found so far. Gustavo > Date: Fri, 30 May 2008 11:26:11 +0800> To: cur...@gm...; ope...@li...> Subject: Re: [OpenSIPStack] Memory Leak in Proxy and Full Mode> From: joe...@gm...> > Hi Gustavo,> > Take a look at void ProxySession::OnFinalResponse( SIPMessage & message > ) method. Can you verify if the object created in:> > manager.CreateTuple( m_OriginalInvite, m_RoutedInvite, 10 );> > Actually expires after 10 seconds?> > Putting a breakpoint at ProxySessionTupleManager::Tuple::~Tuple() should > be enough to confirm it.> > Also by any chance, did you accidentally think that this tuple is the > mem leak because it was created after the transaction?> > Joegen> > > Gustavo Curetti wrote:> > Hi Joegen> > > > I found a memory leak when the OpenSBC is configured in Proxy or Full mode. When i send a 200 Ok for example in B2B mode there is no memory leak, but when i send a 200 ok in Proxy or Full mode, some memory is taken and never released. I attach the logs. The OpenSBC (192.168.0.202:5070) is running under Windows.> > > > Thanks for your help> > > > Gustavo> > _________________________________________________________________> > Ingresá ya a MSN Deportes y enterate de las últimas novedades del mundo deportivo.> > http://msn.foxsports.com/fslasc/> > ------------------------------------------------------------------------> >> > -------------------------------------------------------------------------> > This SF.net email is sponsored by: Microsoft> > Defy all challenges. Microsoft(R) Visual Studio 2008.> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> > ------------------------------------------------------------------------> >> > _______________________________________________> > opensipstack-devel mailing list> > ope...@li...> > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel> > > > ------------------------------------------------------------------------> >> > No virus found in this incoming message.> > Checked by AVG. > > Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM> > > > Ingresá ya a MSN en Concierto y disfrutá los recitales en vivo de tus artistas favoritos. MSN en Concierto _________________________________________________________________ Descargá ya gratis y viví la experiencia Windows Live. http://www.descubrewindowslive.com/latam/index.html |