alphacep / alphacep/vosk-server

Memory usage increasing too much?

Offen
#149 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
1.3k
Forks
317
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hello,

pointing at issue [#711](https://github.com/alphacep/vosk-api/issues/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](https://github.com/nefastosaturo/vosk-server/blob/05821c059ef4959fdda889f6dce33ccae8bb3ca8/websocket/asr_server.py#L70-L72) 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:

- clone my [fork](https://github.com/nefastosaturo/vosk-server)
- `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](https://medium.com/analytics-vidhya/docker-tensorflow-gui-matplotlib-6cdd327d4a0f) )
- use multiple `test_ffmpeg.py` and `test_microphone.py` in the `websocket` folder to simulate different connections, close them, start them again, rinse, repeat

What 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)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.