VmRSS memory keep increasing for interlaced streams while decoding using gst-v4l2 decoder
For a long duration interlaced stream, VmRSS memory keeps increasing during decoding. We have tried in nvidia platform with below pipeline: gst-launch-1.0 filesrc location = H264_15min_25.ts ! tsdemux ! h264parse ! nvv4l2decoder ! fakesink sync = 0 Also tried with odroid board(samsung exynos) with below pipeline: gst-launch-1.0 filesrc location = H264_15min_25.ts ! tsdemux ! h264parse ! v4l2video10videodec ! fakesink sync = 0
With both the above platform we are observing memory increase.
Logs: (Check RES values):
- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
- 7897 nvidia 20 0 426256 35636 19720 S 31.2 0.9 0:00.95 gst-launch-1.0
- 7897 nvidia 20 0 426256 61672 19720 S 114.8 1.5 5:16.66 gst-launch-1.0
Probable cause would be that in case of interlaced streams frame->input_buffer(top field+bottom field) count is double w.r.t frame->output_buffer count, and in gstv4l2videodec.c we are doing unref of frames after frame->output_buffer is set, so we are doing unref half number of frames w.r.t actual number of frames. Reference file: https://github.com/GStreamer/gst-plugins-good/blob/b4b79a211fc487d4bae5962721ed812713e9a705/sys/v4l2/gstv4l2videodec.c#L749