Debugging GStreamer : refcounting

Tim-Philipp Müller t.i.m at zen.co.uk
Mon Jul 15 02:46:01 PDT 2013


On Mon, 2013-07-15 at 11:17 +0200, Thomas Scheuermann wrote:

Hi,

> I use here gstreamer-sdk with gstreamer-0.10 on a 32-bit debian wheezy.
> I want to debug the reference counters and found the debug variable:
> GST_DEBUG=GST_REFCOUNTING:5
> but I can't interpret the output.
> Is there a way to see if there are any references which need to be
> unrefed but which are not?
> 
> In the end we are looking here for memory problems with gstreamer,
> because it crashes after it has reached 3GB memory.

if you're on Linux, I'd recommend the valgrind suite of tools.

 $ G_SLICE=always-malloc valgrind --leak-check=yes yourapplication

(you can also pass suppression files from the GStreamer common module so
it doesn't report one-time allocations in GObject and GStreamer and
things like that, cuts down the noise a little).

Then there's also the valgrind tool "massif", with which you can track
where what gets allocated over time. This is useful if it doesn't leak,
but just builds up somewhere. Again, use G_SLICE=always-malloc.

Cheers
 -Tim



More information about the gstreamer-devel mailing list