Menu

memory leak in pocketsphinx_batch

Help
asr2010
2012-03-09
2012-09-22
  • asr2010

    asr2010 - 2012-03-09

    I am trying to use different MLLR matrices. Each testing utterance has a MLLR
    matrix. I tried the pocketsphinx_batch using the following parameters:
    -mllrctl -mllrdir -mllrext
    The batch test is working perfect for a small testing set. When I increase the
    testing set I found out that pocket sphinx allocate more memory for each
    utterance until the total allocated memory reach ~4GB then I get a crash.
    the last message from pocketsphinx was:
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter:
    C:/Users/..............cd_cont_3000_32/variances
    calloc(2900928,4) failed from ....\src\libpocketsphinx\ms_gauden.c(263)

     
  • Nickolay V. Shmyrev

    Which version are you talking about

     
  • asr2010

    asr2010 - 2012-03-09

    the latest snapshot of pocketsphinx and sphinxbase...

     
  • asr2010

    asr2010 - 2012-03-09

    I feel that gaussians are allocated for each MLLR matrix without "Free"ing the
    pointer if allocated

     
  • asr2010

    asr2010 - 2012-03-09

    Problem solved. I traced the source code. I think you need to add the
    following fix:
    in file ms_gauden.c, in gauden_mllr_transform function:
    add:
    if (g->mean)
    gauden_param_free(g->mean);
    before:
    g->mean = (mfcc_t *)fgau;
    Add:
    if (g->var)
    gauden_param_free((mfcc_t
    )g->var);
    Before:
    g->var = (mfcc_t
    ***)fgau;

    The above code will fix the memory leak problem and pocketsphinx didn't crash
    in my case. However I can see in the resource monitor that there still exist a
    very small memory leak

     
  • Nickolay V. Shmyrev

    Thanks for the nice catch, the bug was fixed in trunk right now.

    The fix was a little bit different from what you are proposing, it fixes more
    memory leaks so please update from subversion. Please also note that you can
    use valgrind tool to debug memory leaks.

     

Log in to post a comment.