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)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)
Which version are you talking about
the latest snapshot of pocketsphinx and sphinxbase...
I feel that gaussians are allocated for each MLLR matrix without "Free"ing the
pointer if allocated
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
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.