Open nefastosaturo opened 2 years ago
Hi
Your repo misses asr_server_memprof.py I suppose, but I don't think there is a point in running it at all.
In general, the point is that Python never frees memory, you won't be able to see memory release in the way you are doing it:
https://stackoverflow.com/questions/15455048/releasing-memory-in-python
You can use valgrind/massif if you want to debug memory operations probably or some other memory profiler.
Hello,
pointing at issue #711 on vosk-api repo , I'm trying to understand a little bit more how vosk manages the memory.
For this test I modified a little bit and very roughly asr_server.py so that it creates a new recognizer on a new websocket connection.
I'm using the italian model at 16kHz with Docker on my laptop with 16GB RAM, i7 7700HQ laptop.
Steps to reproduce:
docker build -t alphacep/kaldi-it -f Dockerfile.kaldi-it-memfree .
docker build -t alphacep/kaldi-it-memprof -f Dockerfile.kaldi-it-plot-mprof .
(yeah it could be merged in one single dockerfile, I know, just for testing purpose)docker run -it -p 2700:2700 --env="DISPLAY" --net=host -v="$HOME/.Xauthority:/root/.Xauthority:rw" alphacep/kaldi-it-memprof
(as suggested here )test_ffmpeg.py
andtest_microphone.py
in thewebsocket
folder to simulate different connections, close them, start them again, rinse, repeatWhat expected:
memory to be released on each websocket disconnection
What we got:
memory continue to increase
From the graph image attached the first disconnection release some memory, then it just goes up.
Is this behaviour correct?![Screenshot from 2021-10-20 14-57-35](https://user-images.githubusercontent.com/10575994/138112388-a2edd0d8-5803-47e0-aa97-620441170f84.png)