py-kaldi-asr icon indicating copy to clipboard operation
py-kaldi-asr copied to clipboard

[BUG] Memory leaks - Decoder in thread

Open madkote opened this issue 6 years ago • 0 comments

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 decoder is used. Deleting the model has not effect, since it leaving much bigger leak in the memory (see #36)

madkote avatar Dec 06 '19 10:12 madkote