AnsweredAssumed Answered

Memory leak in timer create and delete

Question asked by sasi_bala on Mar 25, 2013
Latest reply on Apr 2, 2013 by sonic

Hi,

 

    I'm using timer in my application and I see memory leak when timer is create/delete very often. Could some one help me on this?

 

Following are the parameters used in timer creation

{

    struct sigaction stSigact;

    struct sigevent stSigevent;

    memset(&stSigact,0x00,sizeof(stSigact));

    stSigact.sa_sigaction = (void*)Timeout_Handler;

    sigemptyset(&stSigact.sa_mask);

 

    stSigact.sa_flags = SA_SIGINFO;

    (void) sigaction(SIGALRM, &stSigact, NULL);

    memset(&stSigevent,0x00,sizeof(stSigevent));

    stSigevent.sigev_notify = SIGEV_SIGNAL;

    stSigevent.sigev_signo = SIGALRM;

     /* Set the state as signal value to identify from which timer the signal is generated*/

    stSigevent.sigev_value.sival_int = pstClkTimerValues->eState;

 

     /* Create and arm periodic mark timer */

    timer_create(CLOCK_REALTIME, &stSigevent,&TimerID) ;

 

 

}

Outcomes