Gstreamer Memory Tracing using mtrace

Tim-Philipp Müller t.i.m at zen.co.uk
Tue Jul 23 05:47:04 PDT 2013


On Tue, 2013-07-23 at 07:33 -0500, Randall Scheifele wrote:

Hi,

> Has anyone attempted to use mtrace with gstreamer?  Even with the
> simplest gstreamer program I get tons of memory not free'd errors.
> 
> 
> For example, here is my simple program:
> 
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <gst/gst.h>
> #include <mcheck.h>
> 
> 
> int main(int argc, char* argv[])
> {
> // Start memory tracing
> mtrace();
> 
> // Initialize gstreamer
> gst_init(&argc, &argv);
> 
> 
> // Cleanup gstreamer
> gst_deinit();
> 
> 
> // Stop memory tracing
> muntrace();
> 
> 
> return 0;
> }
> 
> 
> When I run this on my ubuntu 10.04 machine running gstreamer 0.10.28,
> I get the following output from mtrace.  I realize that 0.10.28 is an
> outdated version, but is my test valid?  Is there any way I can get
> mtrace to say no memory leaked?
> 
> 
> I am actually running gstreamer 0.10.32 on an embedded system and am
> just playing with mtrace on the host to try and get to a point where I
> don't get any memory errors.  If I can't get the list down I won't be
> able to determine which errors are always there versus the ones I'm
> interested in fixing in my application or plugins.  I've heard good
> things about valgrind, but it is not ported for my target
> architecture.

Both GStreamer and GLib/GObject will do a number of one-time
allocations, which will may never be cleaned up, so it's kind of
expected that you still see allocated memory at the end.

Cheers
 -Tim




More information about the gstreamer-devel mailing list