memory leaks

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

memory leaks

Thornton, Keith

Hi, I’m currently chasing leaks in my application using the tracer. I have plenty of dynamic branches which I link to my pipelines when we start / stop recording etc.

I have used gst_bus:set_sync_handler and for each message I receive I return GST_BUS_PASS

At the end when I terminate I receive the following leak report

 

0:33:18.506654827  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000017893760, description=(string)<bus0>, ref-count=(uint)2, trace=(string);

0:33:18.506668610  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000017893F40, description=(string)<bus5>, ref-count=(uint)14, trace=(string);

0:33:18.506679753  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)00000000401585A0, description=(string)<bus41>, ref-count=(uint)1, trace=(string);

0:33:18.506690309  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040118220, description=(string)<bus54>, ref-count=(uint)1, trace=(string);

0:33:18.506700280  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040329CA0, description=(string)<bus17>, ref-count=(uint)1, trace=(string);

0:33:18.506710250  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000017893E60, description=(string)<bus6>, ref-count=(uint)2, trace=(string);

0:33:18.506742800  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040118140, description=(string)<bus51>, ref-count=(uint)4, trace=(string);

0:33:18.506755702  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040158CA0, description=(string)<bus46>, ref-count=(uint)1, trace=(string);

0:33:18.506765966  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040329BC0, description=(string)<bus18>, ref-count=(uint)1, trace=(string);

0:33:18.506775936  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000017893D80, description=(string)<bus7>, ref-count=(uint)1, trace=(string);

0:33:18.506785906  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040189060, description=(string)<bus22>, ref-count=(uint)1, trace=(string);

0:33:18.506795876  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040189840, description=(string)<bus29>, ref-count=(uint)1, trace=(string);

0:33:18.506805847  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)00000000401D2220, description=(string)<bus10>, ref-count=(uint)2, trace=(string);

0:33:18.506815817  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040158220, description=(string)<bus38>, ref-count=(uint)1, trace=(string);

0:33:18.506825787  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040158A00, description=(string)<bus45>, ref-count=(uint)1, trace=(string);

0:33:18.506835757  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040189E60, description=(string)<bus33>, ref-count=(uint)1, trace=(string);

0:33:18.506845434  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)00000000401D2140, description=(string)<bus9>, ref-count=(uint)1, trace=(string);

0:33:18.506855405  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000017893AE0, description=(string)<bus4>, ref-count=(uint)2, trace=(string);

0:33:18.506865375  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040158140, description=(string)<bus37>, ref-count=(uint)1, trace=(string);

0:33:18.506875345  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040189D80, description=(string)<bus34>, ref-count=(uint)1, trace=(string);

0:33:18.506885315  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)00000000401D2060, description=(string)<bus8>, ref-count=(uint)2, trace=(string);

0:33:18.506894992  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040329760, description=(string)<bus14>, ref-count=(uint)1, trace=(string);

0:33:18.506904962  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)00000000401894C0, description=(string)<bus26>, ref-count=(uint)1, trace=(string);

0:33:18.506914933  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000017893920, description=(string)<bus2>, ref-count=(uint)1, trace=(string);

0:33:18.506924903  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)00000000401183E0, description=(string)<bus52>, ref-count=(uint)3, trace=(string);

0:33:18.506935460  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040329680, description=(string)<bus13>, ref-count=(uint)1, trace=(string);

0:33:18.506946016  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)00000000401893E0, description=(string)<bus25>, ref-count=(uint)1, trace=(string);

0:33:18.506955693  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040158F40, description=(string)<bus49>, ref-count=(uint)1, trace=(string);

0:33:18.506965663  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040329E60, description=(string)<bus21>, ref-count=(uint)1, trace=(string);

0:33:18.506975340  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000017893840, description=(string)<bus1>, ref-count=(uint)2, trace=(string);

0:33:18.506985311  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040158680, description=(string)<bus42>, ref-count=(uint)1, trace=(string);

0:33:18.506995281  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040118300, description=(string)<bus53>, ref-count=(uint)1, trace=(string);

0:33:18.507004958  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040158E60, description=(string)<bus50>, ref-count=(uint)1, trace=(string);

0:33:18.507014928  4352 00000000401A3630 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0000000040189AE0, description=(string)<bus30>, ref-count=(uint)1, trace=(string);

 

Does anyone know what I have done wrong?


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: memory leaks

Nicolas Dufresne-5
Le mardi 09 mai 2017 à 12:14 +0000, Thornton, Keith a écrit :
> 0:33:18.507014928  4352 00000000401A3630 TRACE             GST_TRACER
> :0:: object-alive, type-name=(string)GstBus,
> address=(gpointer)0000000040189AE0, description=(string)<bus30>, ref-
> count=(uint)1, trace=(string);
>  
> Does anyone know what I have done wrong?

In your code that sets the bus handler, did you forgot to unref the
GstBus ? Looks like a GstBus is leaked for every pipeline. Be aware
that you can set GST_LEAKS_TRACER_STACK_TRACE=1 to get backtrace of
where in your code that GstBus was allocated.

regards,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

AW: memory leaks

Thornton, Keith
Thanks nicolas, you are quite right, I was missing an unref. The GST_LEAKS_TRACER_STACK_TRACE switch probably won't help much as the application is running on a cerbero built windows :-(
Grüße

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von Nicolas Dufresne
Gesendet: Dienstag, 9. Mai 2017 19:41
An: Discussion of the development of and with GStreamer <[hidden email]>
Betreff: Re: memory leaks

Le mardi 09 mai 2017 à 12:14 +0000, Thornton, Keith a écrit :
> 0:33:18.507014928  4352 00000000401A3630 TRACE             GST_TRACER
> :0:: object-alive, type-name=(string)GstBus,
> address=(gpointer)0000000040189AE0, description=(string)<bus30>, ref-
> count=(uint)1, trace=(string);
>  
> Does anyone know what I have done wrong?

In your code that sets the bus handler, did you forgot to unref the GstBus ? Looks like a GstBus is leaked for every pipeline. Be aware that you can set GST_LEAKS_TRACER_STACK_TRACE=1 to get backtrace of where in your code that GstBus was allocated.

regards,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel