Huge memory leak sometime after starting a pipeline

Sebastian Dröge sebastian at centricular.com
Thu Nov 6 01:28:54 PST 2014


On Mi, 2014-11-05 at 21:26 +0000, Chris Tapp wrote:
> My application uses gst_parse_launch to create a pipleline of the form:
> 
>    playbin av-offset=-50000000 buffer-size=0 buffer-duration=0 name="name" uri=http://dvb:4242/bysid/4352 audio-sink="alsasink" video-sink="videoconvert ! videoscale ! video/x-raw,format=(string)RGBA,width=300,height=200 ! fakesink sync=true
> 
> It then uses the pipeline "sample" property to read frames as required.
> 
> This generally works fine, but after some time (from a few minutes to many hours) a memory leak develops which leads to the program being terminated. The application itself processes all samples the same (basically copies the image to a gl texture without holding any references and no control-flow variations).
> 
> Examining the log created with GST_DEBUG=GST_MEMORY:5 for a particular run shows that the number of calls to _gst_memory_init and _gst_memory_free are basically the same when the application works normally, but there is a significant deficit of calls to _gst_memory_free when it goes wrong:
> 
>    Timestamp
>    0:36:45   50 more _init than _free
>    0:52:43   61 more _init than _free
>    0:59:45   55 more _init than _free
>    1:09:00   76796  more _init than _free
> 
> How should I go about trying to work out what's going on?

If it is a leak, you can try with valgrind's memchecker... if it's
memory accumulating somewhere but not being lost you can check with
valgrind's massif tool where a lot of memory is allocated.

Alternatively the TRACE (7) debug level will give you details about when
and where every memory and surrounding buffer is reffed, unreffed and
also where it was last seen.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141106/351d9122/attachment.sig>


More information about the gstreamer-devel mailing list