A workaround is to add the
-m 512m option to the Docker command to cap the container’s available memory to 512 megabytes. That’s just an arbitrary number of course. You should take a look at the output of
docker stats and see how much RAM your container is normally using. After your container reaches its memory limit, it will be killed, and restarted if you added the
--restart unless-stopped option like in Rhasspy’s docs.
Of course the fundamental problem is that there’s a memory leak, but until that is found, you should be able to manage with this workaround without freezing your Raspberry Pi. Unless it’s really every couple minutes, because that’s quite unusable…