Memory leak after just call gst_init()

Tim-Philipp Müller t.i.m at zen.co.uk
Mon Apr 4 10:06:50 PDT 2011


On Mon, 2011-04-04 at 13:54 -0300, raul cordeiro holanda wrote:

> I'm fronting a problem of memory leak (that i detect with valgrind
> test tool) on my app and after some time i discover that
> if i just init the gstreamer lib (with gst_init()) and after finalize
> it (sith gst_deinit()) the memory leak is the same. After
> test my app without gst_* calls, no memory leak is detected. So, after
> search on web, i found some people with the same
> problem and no solutions shown, how i see on topic below of
> gstreamer-devel (and some others)
> 
> http://gstreamer-devel.966125.n4.nabble.com/quot-Possibly-lost-quot-memory-shown-by-valgrind-during-gst-init-check-td972463.html
> 
> I must say that i set the env vars
> 
> G_SLICE=always-malloc 
> G_DEBUG=gc-friendly
> 
> So, i'd like to know if it is really a know-bug or it's a wrong lib
> use of my part. If it's a using problem, someone has
> tips for solution?
> 
> I really be grateful for some help/tips.

My reply from back then is still true. gst_init() does a number of
one-time allocations which gst_deinit() doesn't/can't clean up, esp.
inside GObject. You may want to use GStreamer's gst.supp valgrind
suppression file from the common module to suppress these kind of leaks,
just like our own unit tests do when they run under valgrind.

Cheers
 -Tim



More information about the gstreamer-devel mailing list