Gstreamer & GLib memory management/profiling

Sergei Vorobyov sergei.vorobyov at facilitylabs.com
Fri Oct 31 05:46:27 PDT 2014


GLib's memory profiling seems incompatible with GStreamer. The snippet:

extern GMemVTable *glib_mem_profiler_table;

gint main (gint argn, gchar** args) {
    GError *e;
    g_mem_set_vtable (glib_mem_profiler_table);
    if (g_mem_is_system_malloc ())
        g_print ("system malloc is used\n");
    else
        g_print ("NOT system malloc is used\n");
    g_print ("********************* point 1\n");
    if (!gst_init_check (&argn, &args, &e)) {
        g_print ("failed gst_init_check: %s\n", e->message);
    }
    g_print ("********************* point 2\n");

    g_mem_profile ();

    ...

crashes at gst_init producing:

fl at nuc5:~/bin$ ./mp-v01.020
NOT system malloc is used
********************* point 1

(mp-v01.020:15561): GLib-WARNING **: free(0x1b32fd0): memory has been freed
12297829382473034410 times already
*** Error in `./mp-v01.020': realloc(): invalid pointer: 0x0000000001b35e80
***
Aborted (core dumped)

(it does not happen if I don't call gst_init; although I need to call it at
some point...)

Any recipes? I use lots of GLib's memory de/allocations...
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141031/251f6869/attachment.html>


More information about the gstreamer-devel mailing list