Gstreamer memory leak: how do I hunt it down?

Graham Leggett minfrin at sharp.fm
Sun Dec 18 15:58:55 UTC 2016


On 18 Dec 2016, at 10:57 AM, Sebastian Dröge <sebastian at centricular.com> wrote:

>> 0:01:01.779640164  1232 0x740f7580 TRACE        GST_REFCOUNTING
>> gstobject.c:275:gst_object_unref:<allocatorsysmem0> 0x74204818 unref
>> 5958->5957
> 
> This suggests that something somewhere is leaking system memory
> GstMemory. Each of them has a reference to its allocator, so you seem
> to have about 6000 of them around currently.
> It's not the allocator that is leaked here though.

This makes more sense now.

> Use valgrind, valgrind's massif or the GStreamer leak tracer for
> tracking this down. Also before doing anything like that, make your
> pipeline as minimal as possible.

Narrowed it down to the tsparse element. 

Valgrind doesn’t run on a pi, and neither does LeakAnalyzer, so I’m stuck with the gstreamer leak tracer. Is this documented anywhere?

All I could find was https://www.collabora.com/news-and-blog/blog/2016/06/20/gstreamer-leaks-tracer/, and following the instructions leads to just this, which appears to show the leak tracer is present, but it isn’t telling me anything I understand:

minfrin at towerofpi9:/var/www/html/stream$ cat /mnt/stream/stream22.out | grep TRACER
0:00:00.417222937  5468 0x73f75fa0 DEBUG             GST_TRACER gsttracer.c:163:gst_tracer_register:<registry0> update existing feature 0x74104888 (latency)
0:00:00.417918242  5468 0x73f75fa0 DEBUG             GST_TRACER gsttracer.c:163:gst_tracer_register:<registry0> update existing feature 0x74104900 (log)
0:00:00.418445632  5468 0x73f75fa0 DEBUG             GST_TRACER gsttracer.c:163:gst_tracer_register:<registry0> update existing feature 0x74104978 (rusage)
0:00:00.418818024  5468 0x73f75fa0 DEBUG             GST_TRACER gsttracer.c:163:gst_tracer_register:<registry0> update existing feature 0x741049f0 (stats)
0:00:00.419100260  5468 0x73f75fa0 DEBUG             GST_TRACER gsttracer.c:163:gst_tracer_register:<registry0> update existing feature 0x74104a68 (leaks)
0:00:00.420038063  5468 0x73f75fa0 TRACE             GST_TRACER gsttracerrecord.c:110:gst_tracer_record_build_format: object-alive.class, type-name=(structure)"value\,\ type\=\(GType\)NULL\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", address=(structure)"value\,\ type\=\(GType\)NULL\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", description=(structure)"value\,\ type\=\(GType\)NULL\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", ref-count=(structure)"value\,\ type\=\(GType\)NULL\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;", trace=(structure)"value\,\ type\=\(GType\)NULL\,\ related-to\=\(GstTracerValueScope\)GST_TRACER_VALUE_SCOPE_PROCESS\;";
0:00:00.421316747  5468 0x73f75fa0 DEBUG             GST_TRACER gsttracerrecord.c:124: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;

Regards,
Graham
—




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3240 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161218/55264e8b/attachment.bin>


More information about the gstreamer-devel mailing list