ggerganov/whisper.cpp

memory leak when deallocating and reallocating WhisperContext

yousifa opened this issue · 11 comments

Deallocating WhisperContext (from swift) will leave memory allocated (1-10mb)

To replicate:
Call WhisperContext() and then set it to nil in the demo whisper swiftui app repeatedly. Memory will continue growing.

chnbr commented

I can confirm this. Sometimes the memory loss is up to 30MB.

Yep, the amount it retains seems inconsistent and random

Thanks for reporting. I'll take a look in the next days. Let me know if you find what is the resource that leaks or the commit that caused the regression.

Thanks, I'm looking into it too. This issue has existed for at least 6 months, as that was the version I was using when i first noticed it (and it still exists in the latest).