Savant
Savant copied to clipboard
Switching sources causes minor memory leaks
simple module
echo "
name: test-module
parameters:
max_parallel_streams: 1
batch_size: 1
" | python -m savant.entrypoint
client
import os
from savant.client import JpegSource, SourceBuilder
module_hostname = os.environ.get('MODULE_HOSTNAME', 'localhost')
healthcheck_url = f'http://{module_hostname}:8080/status'
source_id = 'test-source'
source = (
SourceBuilder()
.with_socket('dealer+connect:ipc:///tmp/zmq-sockets/input-video.ipc')
.with_module_health_check_url(healthcheck_url)
.build()
)
src_jpeg = JpegSource(source_id, file='/data/images/bus.jpg')
for n in range(1000):
_ = source(src_jpeg, send_eos=True)
print('Done')
Monitor memory consumption with e.g. nvtop. Each client run (1k source change) adds +10M RSS MEM for the app module.