Alexsander,

Please find the valgrind log for the following sample application.

Operation performed was 1. register a URI 2. Re-register the same URI

Regards

anees k A


On Tue, Jun 18, 2013 at 10:47 AM, Anees K A
<anees...@mistralsolutions.com>wrote:

> Dear Alexsander,
>
> Yes, I am re-using the same nua_handle for repeated calls.
>
> Mean time this is when the problem comes.
>
>    1. When REGISTER goes out *Contact: <sip:192.168.100.38>;q=0.1*
>    2. The 200OK for that will contain *Contact:
>    <sip:192.168.100.38>;q=0.3;expires=3600*
>    3. When this response comes, *msg_avlist_d()* gets called to parse the
>    parameters.
>    4. Inside that function, the parameters "*;q=0.3;expires=3600"* are
>    parsed and saved
>    5. This memory (32bytes) is never getting freed
>    6. If next register goes with *q=0.3* , I can see that another 32byte
>    is getting allocated.
>
> I will post valgrind results soon.
>
>
> Regards
>
> anees k A
>
>
> On Mon, Jun 17, 2013 at 8:27 PM, Alexsander Petry <
> alexsanderpe...@gmail.com> wrote:
>
>> Are you using the same nua_handle (op->op_handle) for each REGISTER?
>> Try to run with valgrind and post the results.
>>
>>
>>  2013/6/17 Anees K A <anees...@mistralsolutions.com>
>>
>>>  Hi,
>>>
>>> I am using SIP REGISTER method to create a conference factory. For that
>>> I am using 'q' factor parameter in REGISTER to let the server know of the
>>> current load.
>>>
>>> When q value changes, I am calling re-registration with new q value. I
>>> am seeing that this second call is causing the application to allocate more
>>> memory rather than using what is already allocated. If this operation is
>>> let to run for 1 day, the memory usage can be seen as increasing.
>>>
>>> The register call I use is as follows
>>>
>>> nua_register(op->op_handle,
>>>                     NUTAG_M_FEATURES('q=1.0'),
>>>                     TAG_NULL());
>>>
>>> Has anyone point me what I am doing wrong ?
>>>
>>> Regards
>>>
>>> anees k A
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by Windows:
>>>
>>> Build for Windows Store.
>>>
>>> http://p.sf.net/sfu/windows-dev2dev
>>> _______________________________________________
>>> Sofia-sip-devel mailing list
>>> Sofia-sip-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
>>>
>>>
>>
>>
>> --
>> Alexsander Petry
>>
>
>
void registerUrl()
{
    if(!appl->s_nh_reg)
    {
        appl->reg_status = 1;
        appl->s_nh_reg = nua_handle(appl->s_nua[0], NULL,
                    SIPTAG_TO_STR("sip:aneeskA@192.168.15.39"),
                    SIPTAG_FROM_STR("sip:aneeskA@192.168.15.39"),
                    SIPTAG_EXPIRES_STR("3600"),
                    //SIPTAG_CONTACT_STR("sip:192.168.100.38:5060"),
                    NUTAG_ALLOW("INFO"),
                    TAG_NULL());
    }
    nua_register(appl->s_nh_reg,
                    NUTAG_M_FEATURES("q=0.3"),
                    TAG_NULL());
}

void * stack_init(void *ptr )
{
    su_init();
    su_home_init(appl->s_home);
   
    /* initialize root object */
    appl->s_root = su_root_create(appl);
    
    if (appl->s_root != NULL) {
        /* create NUA stack */
        appl->s_nua = nua_create(appl->s_root,
                                 app_callback,
                                 appl,
                                 /* tags as necessary ...*/
                                 TAG_NULL());
       
        if (appl->s_nua != NULL) {
            /* set necessary parameters */
            nua_set_params(appl->s_nua,
                           SIPTAG_ALLOW_STR("OPTIONS"),
                           TAG_NULL());
            registerUrl();
            /* enter main loop for processing of messages */
            su_root_run(appl->s_root);
        }
    }
}

void stack_finish()
{
    if (appl->s_nua != NULL) {
        /* destroy NUA stack */
        nua_destroy(appl->s_nua);
    }
    /* deinit root object */
    su_root_destroy(appl->s_root);
    appl->s_root = NULL;

    /* deinitialize memory handling */
    su_home_deinit(appl->s_home);
    /* deinitialize system utilities */
    su_deinit();
}

Attachment: valgrind.log
Description: Binary data

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to