Nvvideoconvert element produces memory increases in a create-start-stop-delete sequence

Hi all.

I have been testing a few GStreamer pipelines in order to check the memory usage in create-start-stop-delete sequences. I am using RidgeRun’s Gstreamer Daemon (gstd) to perform such operations on the pipelines.

In this case I focused on the nvvideoconvert + nvv4l2h264enc combination.

Setup details:
• Jetson TX2
• DeepStream 5.0.0
• JetPack 4.4.3
• TensorRT 7.1.3

Here is the very basic script I am using:

#!/bin/bash

function interrupt() {
	echo
	echo "Ctrl-C interruption"
	rm -rf ./data/
	
	gstd-client pipeline_delete p1
	exit
}

i="0"

while [ $i -lt 100 ]
do
	echo "Creating p1"
	gstd-client pipeline_create p1 videotestsrc ! nvvideoconvert ! "video/x-raw(memory:NVMM)" ! nvv4l2h264enc insert-sps-pps=true iframeinterval=5 control-rate=1 profile=4 qos=false maxperf-enable=true name=h264_encoder ! fakesink

	echo "Playing p1"
	gstd-client pipeline_play p1
	sleep 10

	echo "Stopping p1"
	gstd-client pipeline_stop p1
	gstd-client pipeline_delete p1
	sleep 8

	i=$[$i+1]
done

It runs the create-play commands, waits for 10 seconds, runs the stop-delete commands, waits for 8 seconds and repeats the cycle. Each test was performed during 400 seconds.

Results:

I am also using a script that runs pmap to extract the shared, private and mapped memory of a specific process (gstd in this case). This script also provides plots of the memory usage, which are presented below as part of the results.

  • Pipeline A: nvvideoconvert + nvv4l2h264enc
gstd-client pipeline_create p1 videotestsrc ! nvvideoconvert ! "video/x-raw(memory:NVMM)" ! nvv4l2h264enc insert-sps-pps=true iframeinterval=5 control-rate=1 profile=4 qos=false maxperf-enable=true name=h264_encoder ! fakesink

Private Memory:

Mapped Memory:

Shared Memory:

  • Pipeline B: nvvideoconvert only
gstd-client pipeline_create p1 videotestsrc ! nvvideoconvert ! "video/x-raw(memory:NVMM)" ! fakesink

Private Memory:

Mapped Memory:

Shared Memory:

I would appreciate any advice or suggestion on how to avoid this behavior, including any property that should be set.

Thank you in advance,

-JC

Hello,

Please refer this bug: Memory Leak in Video Recording