vosk-api
vosk-api copied to clipboard
Memory Leak Issues with Vosk using NodeJS
I'm having memory leak issues with Vosk. By default, just starting up the program I've implemented Vosk with uses about 150mb of RAM. Everytime a user talks, the memory keeps increasing and never decreases until the program completely crashes and has to restart due to lack of memory. I'm not sure how to fix it and it appears to be directly related to Vosk.
Which version? Which model?
Which version? Which model?
Vosk NPM package is v0.3.31 I'm using vosk-model-small-en-us-0.15
How much memory do you have in total?
What is your hardware?
I've tested both on my PC (with 12GB of RAM), and my server environment which is in a PM2 container allowing for 2.5GB max of RAM before auto restarting. The PM2 server environment restarts frequently due to Vosk memory problems and the RAM increase is more visible because of multiple transcriptions happening at once. On my PC, it doesn't crash because there is a lot of RAM, but the memory increase is still apparent despite transcribing less users at once.
My PC hardware is as follows: Processor: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 3401 Mhz, 4 Core(s), 8 Logical Processor(s) 12GB of RAM
PM2 Server Enviornment hardware: Processor: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz 2.5 GB of available RAM in PM2 container, 4GB of RAM on full server.
Let me know if you need any more info. 😀
What is your OS?
What is node version?
What is your OS?
PC is Windows Server Environment is Ubuntu (Linux)
What is node version?
PC is v16 Server Environment is v12
I'm also having increasing memory usage using the vosk-model-en-us-librispeech-0.2
on Node 20 and Ubuntu.
I have 8GB memory on the machine and an 8GB swap.
I create one model and free up the Recognizer and Model after each use.
Using htop
, I can see the memory steadily going up after each request.. even with idle time in between.