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

[reSIProcate] Resiprocate:Memory Leak Question


Hi All,

I am using 0.4.0 version and running one of the test server. My test
Server is processing the INVITES and responding back with 200OK and
another 200 for BYE. 

When I look at the top the memory usage of the test server keeps
growing. Is this a memory leak or I need to free something. Attached is
the sample code of my testServer.

         while(calls > 0)

         {
            FdSet fdset;
            mStack.buildFdSet(fdset);
            int err = fdset.selectMilliSeconds(1);
            assert (err != -1);
            mStack.process(fdset);

            SipMessage* received = mStack.receive();
            if (received)
            {
               auto_ptr<SipMessage> forDel(received);
               MethodTypes meth =
received->header(h_RequestLine).getMethod();
               //ErrLog ( << "Server received: " << MethodNames[meth]);
               if ( meth == INVITE )
               {

                  Data localTag = Helper::computeTag(4);
                  auto_ptr<SipMessage>
msg180(Helper::makeResponse(*received, 180, contact));
                  msg180->header(h_To).param(p_tag) = localTag;
                  //ErrLog( << "Sent 180");
                  mStack.send( *msg180);



                  auto_ptr<SipMessage>
msg200(Helper::makeResponse(*received, 200, contact));
                  msg200->header(h_To).param(p_tag) = localTag;
                //ErrLog( << "Sent 200");
                 mStack.send(*msg200);
          
               }


               if ( meth == BYE)
               {
                  cout << "Bye Received" << endl;
                  auto_ptr<SipMessage>
msg200(Helper::makeResponse(*received, 200, contact));
                  calls--;
                  mStack.send(*msg200);
               }


            }
         }

Thanks for your help.

Ritesh