Webrtcbin: Huge increasing memory leak while using appsink instead of autovideosink

Neil C Smith neilcsmith.net at googlemail.com
Mon Jul 8 11:04:18 UTC 2019

On Mon, 8 Jul 2019 at 11:43, Sebastian Dröge <sebastian at centricular.com> wrote:
> With Java doing memory management automatically, wouldn't it be
> possible to do the unmapping automatically too once the GstMapInfo goes
> out of scope?
> That's at least how it's handled in the Rust bindings to prevent
> situations like the above, and generally make everything more memory-
> safe.

Java is very different to Rust here though.  Java is very good at
handling its own memory automatically, but relying on a GC to clear
memory or resources allocated outside of the heap that its managing is
"problematic"!  We do, from a historical perspective, support implicit
memory management of GStreamer objects, but it's not always the ideal
way to handle this (and sometimes the bane of my life! :-) )

We also support explicit disposal (free / unref), and as of v1.0 of
the bindings we also support Java's AutoCloseable for most things
(unfortunately not Buffer::map at present) which allows explicit
scoping of native resources and disposal when they go out of scope.

Deprecating our existing Buffer map support and switching to something
which can be AutoCloseable, perhaps our GstMapInfo wrapper, sounds a
good plan!

Thanks and best wishes,


Neil C Smith
Artist & Technologist

PraxisLIVE - hybrid visual live programming
for creatives, for programmers, for students, for tinkerers

More information about the gstreamer-devel mailing list