Investigating memory leak

Nicolas Dufresne nicolas at ndufresne.ca
Sun Feb 20 22:40:48 UTC 2022


Le dim. 20 févr. 2022 16 h 51, Pieter Hulshoff <pieter at towel42.nl> a écrit :

> 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.
>

Oh, I miss counted the zeros. Will retry tomorrow. Can you attach your
example to the issue, it's cleaner and smaller.


>
> > 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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220220/e40dda7b/attachment-0001.htm>


More information about the gstreamer-devel mailing list