py-kaldi-asr
py-kaldi-asr copied to clipboard
[BUG] Memory leaks - Decoder in thread
Similar issue as with the model (#36).
Scenario
decoder n files in a list with
- option A - use same decoder
decoder = KaldiNNet3OnlineDecoder(model)
try:
for filename in [...]:
decode(decoder, filename)
finally:
del decoder
- option B - create a new decoder for each file
def decode(filename):
decoder = KaldiNNet3OnlineDecoder(model)
try:
...
finally:
del decoder
for filename in [...]:
decode(filename)
- option C - when running option A and B in separate thread, the memory usage increases by ~10mb for each file, even
del decoderis used. Deleting the model has not effect, since it leaving much bigger leak in the memory (see #36)