< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] [reSIProcate-users] Memory Leak on Resip 1.6


Can you give some line numbers for this? In particular, I need the line numbers in TransactionState where valgrind thinks there is a leak.

(Also, are you really using a pointer to a SharedPtr in your code? That kinda defeats the purpose of having a SharedPtr.)

Best regards,
Byron Campen

Hi Scott,

Thanks for the response..

I deleted the message. It still shows memory allocation from sip stack :
Is there any way to clear the memory allocated by the sip stack. ?
for example:
memory allocated in m_stack.process(fdset);

( from TransactionController ->TransactionState-> makeResponse )
 
      FdSet fdset;
      m_stack.buildFdSet(fdset);
      fdset.selectMilliSeconds(select_time);

      m_stack.process(fdset);
 
         for(msgcount = 0; (msg = m_stack.receive()); ++msgcount)
         {
           // logic
           // delete msg;
        }
Thanks
Jijo



On Tue, May 24, 2011 at 11:49 AM, Scott Godin <sgodin@xxxxxxxxxxxxxxx> wrote:
Not sure what getEventFromMessage does, but you must "delete" the SipMessage returned from Stack::receive, or it will leak.

Scott

On Tue, May 24, 2011 at 11:21 AM, Jijo <realjijo@xxxxxxxxx> wrote:
Hi,
I have been trying to detect a memory allocation problem in resiprocate. I run valgrind and totalview and they point at the  "receive" message that gets the SipMessage pointer. The memory allocation keeps growing. I use shared pointers. Any advice appreciated . Here's sample code from my application :
   
   ::receiveEvent() // gets messages, puts it in an event. Events are in a queue. Event is my own private class
  for(msgcount = 0; (msg = m_stack.receive()); ++msgcount)
      {
         SharedPtr<Event> *event = getEventFromMessage(msg);
         LOG(LOG_INFO, "Adding event %s to the event queue", (*event)->name());
         m_event_queue.add(event)
      }
 
      // In another part of program, process event
::processEvent()
{
       SharedPtr<Event> event = m_event_if.getEvent(100);
        // get SipMessage from event
        // event goes out of scope.
}


_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel


_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/