<div dir="ltr">I am no expert ... so maybe someone else will provide you with better guidance.  But I am guessing that the bug is in this code:  

<a href="https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi">https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi</a><div><br></div><div>You can file a new issue in gitlab (giving full repro steps), and your issue will probably be triaged by the best expert in that area.  You may receive better guidance at that time.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 26, 2019 at 2:54 AM Saurabh Bora <<a href="mailto:saurabh9bora@gmail.com">saurabh9bora@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"><div dir="ltr"><div dir="ltr">Thank You David for the response.<div><br></div><div>Please note that I am using GStreamer version 1.14.5</div><div><br></div><div>I ran valgrind with environment variables as you suggested.</div><div>Please find the attached report (streaming_app_valgrind.log)</div><div><br></div><div>From the valgrind report, I could see memory lost at following places:</div><div>==12284==    by 0x9C73966: gst_rtp_base_payload_sink_event_default (in /home/xruser/lib/libgstrtp-1.0.so.0.1405.0) <br></div><div><br></div><div>==12284==    by 0xBC08E07: gst_vaapipostproc_start (in /home/xruser/lib/gstreamer-1.0/libgstvaapi.so)<br></div><div><br></div><div>==12284==    by 0xBBFF6F5: plugin_init (in /home/xruser/lib/gstreamer-1.0/libgstvaapi.so)<br></div><div><br></div><div>==12284==    by 0xBC03A36: gst_vaapi_plugin_base_ensure_display (in /home/xruser/lib/gstreamer-1.0/libgstvaapi.so)<br></div><div><br></div><div>==12284==    by 0xBC08E07: gst_vaapipostproc_start (in /home/xruser/lib/gstreamer-1.0/libgstvaapi.so)<br></div><div><br></div><div><br></div><div>Experts, please take a look at the valgrind report and guide me further.</div><div><br></div><div>Thanks and Regards,</div><div>Saurabh Bora</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 26, 2019 at 1:00 AM David Ing <<a href="mailto:ding@panopto.com" rel="noreferrer" target="_blank">ding@panopto.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">If you are running on Linux you can try using valgrind.<div><br></div><div>First you need to use these variables at runtime so that memory allocation is performed in a "normal" way (such that valgrind can detect problems).<br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="monospace"><br></font></div></div><div><div><font face="monospace">G_DEBUG="gc-friendly"</font></div></div><div><div><font face="monospace">G_SLICE="always-malloc"</font></div></div></blockquote><div><div><br>The following command can be used to run valgrind where <font face="monospace">$@</font> represents the arguments that are passed to the executable.<br><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="monospace">valgrind \</font></div></div><div><div><font face="monospace">--trace-children=yes \</font></div></div><div><div><font face="monospace">--tool=memcheck \</font></div></div><div><div><font face="monospace">--leak-check=full \</font></div></div><div><div><font face="monospace">--leak-resolution=high \</font></div></div><div><div><font face="monospace">--errors-for-leak-kinds=definite,indirect \</font></div></div><div><div><font face="monospace">--show-leak-kinds=definite,indirect \</font></div></div><div><div><font face="monospace">--show-possibly-lost=no \</font></div></div><div><div><font face="monospace">--num-callers=20 \</font></div></div><div><div><font face="monospace">--error-exitcode=20 \</font></div></div><div><div><font face="monospace">--gen-suppressions=all \</font></div></div><div><div><font face="monospace">executable_name $@</font></div></div></blockquote></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 25, 2019 at 11:10 AM Saurabh Bora <<a href="mailto:saurabh9bora@gmail.com" rel="noreferrer" target="_blank">saurabh9bora@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>Hi Experts,</div>
<br>
I have a gstreamer test pipeline which I run as below:<br>
gst-launch-1.0 videotestsrc is-live=yes ! aspectratiocrop aspect-ratio=4/3<br>
! vp8enc ! rtpvp8pay !<br>
application/x-rtp,media=video,encoding-name=VP8,payload=96 ! rtpvp8depay !<br>
decodebin ! autovideosink<br>
<br>
Also, I have following environment variables set to generate leak trace:<br>
set GST_DEBUG=GST_TRACER:7<br>
set GST_TRACERS=leaks<br>
set GST_DEBUG_FILE=logTrace<br>
<br>
Below is content of logTrace file, which shows leak in capsfilter -<br>
application/x-rtp,media=video,encoding-name=VP8,payload=96. As all the<br>
elements in the pipeline are gstreamer provided and not custom, I do not<br>
understand how I can fix this. Please help and guide.<br>
<br>
========================================================================================================================<br></div><div>0:00:00.802370800 36936 0000000003F425A0 DEBUG             GST_TRACER gsttracer.c:164:gst_tracer_register:<registry0> update existing feature 0000000001077180 (latency)<br>0:00:00.802895700 36936 0000000003F425A0 DEBUG             GST_TRACER gsttracer.c:164:gst_tracer_register:<registry0> update existing feature 0000000001077240 (log)<br>0:00:00.802943700 36936 0000000003F425A0 DEBUG             GST_TRACER gsttracer.c:164:gst_tracer_register:<registry0> update existing feature 0000000001077300 (stats)<br>0:00:00.802988600 36936 0000000003F425A0 DEBUG             GST_TRACER gsttracer.c:164:gst_tracer_register:<registry0> update existing feature 00000000010773C0 (leaks)<br>0:00:00.803093500 36936 0000000003F425A0 TRACE             GST_TRACER gsttracerrecord.c:111:gst_tracer_record_build_format: object-alive.class, type-name=(structure)"value\,\ type\=\(type\)gchararray\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", address=(structure)"value\,\ type\=\(type\)gpointer\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", description=(structure)"value\,\ type\=\(type\)gchararray\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", ref-count=(structure)"value\,\ type\=\(type\)guint\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", trace=(structure)"value\,\ type\=\(type\)gchararray\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;";<br>0:00:00.803149100 36936 0000000003F425A0 DEBUG             GST_TRACER gsttracerrecord.c:125:gst_tracer_record_build_format: new format string: object-alive, type-name=(string)%s, address=(gpointer)%p, description=(string)%s, ref-count=(uint)%u, trace=(string)%s;<br>0:00:00.803360100 36936 0000000003F425A0 TRACE             GST_TRACER gsttracerrecord.c:111:gst_tracer_record_build_format: object-refings.class, ts=(structure)"value\,\ type\=\(type\)guint64\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", type-name=(structure)"value\,\ type\=\(type\)gchararray\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", address=(structure)"value\,\ type\=\(type\)gpointer\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", description=(structure)"value\,\ type\=\(type\)gchararray\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", ref-count=(structure)"value\,\ type\=\(type\)guint\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", trace=(structure)"value\,\ type\=\(type\)gchararray\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;";<br>0:00:00.803498500 36936 0000000003F425A0 DEBUG             GST_TRACER gsttracerrecord.c:125:gst_tracer_record_build_format: new format string: object-refings, ts=(guint64)%I64u, type-name=(string)%s, address=(gpointer)%p, description=(string)%s, ref-count=(uint)%u, trace=(string)%s;<br>0:00:03.355505900 36936 0000000003F425A0 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstCaps, address=(gpointer)0000000004A7F890, description=(string)application/x-rtp, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)VP8, media=(string)video, ref-count=(uint)1, trace=(string);<br></div><div>==========================================================================================================================</div><div><br></div><div>P.S.- The above pipeline is a test pipeline used to demonstrate leak. My original pipeline uses the same capsfilter and hence I need to fix this leak.</div><div><br></div><div>Help Appreciated !</div><div><br></div>--------<br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Thanks and Regards,</div><div dir="ltr">Saurabh Bora<br><div><br></div><div>PH NO : 7038166900</div><div>EMAIL : <a href="mailto:saurabh9bora@gmail.com" style="font-size:12.8px" rel="noreferrer" target="_blank">saurabh9bora@gmail.com</a></div><div>             <a href="mailto:saurabh9bora@outlook.com" rel="noreferrer" target="_blank">saurabh9bora@outlook.com</a></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" rel="noreferrer" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" rel="noreferrer" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div><br clear="all"><div><br></div>-- <br></div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Thanks and Regards,</div><div dir="ltr">Saurabh Bora<br><div><br></div><div>PH NO : 7038166900</div><div>EMAIL : <a href="mailto:saurabh9bora@gmail.com" style="font-size:12.8px" rel="noreferrer" target="_blank">saurabh9bora@gmail.com</a></div><div>             <a href="mailto:saurabh9bora@outlook.com" rel="noreferrer" target="_blank">saurabh9bora@outlook.com</a></div></div></div></div></div></div></div></div></div></div>
</div>
</blockquote></div>