Investigating memory leak

Pieter Hulshoff pieter at towel42.nl
Sun Feb 20 21:51:53 UTC 2022


Hello Nicolas,


Thank you for your insights.


On 20-02-2022 21:49, Nicolas Dufresne via gstreamer-devel wrote:
> There was a very similar report recently:
>
> https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/968#note_1252868
>
> In that report, this type of leak happened in if the bus was unreffed after its
> owner (playbin or the pipeline). Though, I'm run your code here on 1.20.0, and
> there was no leak after 3000 iterations.

I'll read up on that report to see if it provides some more clarity.

Did you reduce the usleep time? The code I sent uses the 100 ms wait 
time, in which case I don't see a problem either, but when I reduce that 
to 10 ms the issue pops up very very fast.


> This is normal, gst_element_factory_make() returns a floating reference, and
> gst_bin_add() will acquire the floating reference, which means your code no
> longer owns the object.

That's good to know. :) That would explain the warnings I got when 
uncommenting them then.


Kind regards,


Pieter Hulshoff




More information about the gstreamer-devel mailing list