Unload plugin library when destroy pipeline

Kevin Song kesong at nvidia.com
Thu Sep 16 06:29:01 UTC 2021


Thanks for your quick feedback. Can I have a quick verify it? I found below code. Can the plugin be unloaded if remove below code?

  /* make resident so we're really sure it never gets unloaded again.
   * Theoretically this is not needed, but practically it doesn't hurt.
   * And we're rather safe than sorry. */
  if (plugin->module)
g_module_make_resident (plugin->module);


From: Sebastian Dröge <sebastian at centricular.com>
Sent: Thursday, September 16, 2021 2:16 PM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Cc: Kevin Song <kesong at nvidia.com>
Subject: Re: Unload plugin library when destroy pipeline

External email: Use caution opening links or attachments

On Thu, 2021-09-16 at 05:40 +0000, Kevin Song via gstreamer-devel wrote:

I found GStreamer don’t unload plugin library when destroy pipeline. Why we have this kind of design? Is it possible to unload the plugin library? We need this as there maybe big library linked to plugin, we need save memory after removed the plugin in the pipeline.

The reason is that getting this right is very complicated. It's not just GStreamer and plugin code that would need to be suitable for unloading (and reloading), but also any plugin's dependencies.
Many libraries don't safely allow this, and even GLib is an example of a library that can't be safely unloaded/reloaded.

For memory usage, shared libraries are usually just mmap'd into the process and because of that don't necessarily use a lot of memory. If your library actually does use a lot of memory, it might be a good sign for it being a case that can't be safely unloaded/reloaded.


--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com<http://www.centricular.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210916/c0cecae0/attachment-0001.htm>


More information about the gstreamer-devel mailing list