leaks

This tracing module tracks the lifetimes of GstObject and GstMiniObject objects and prints a list of leaks to the debug log under GST_TRACER:7 when gst_deinit is called, and also prints a g_warning.

Starting with GStreamer 1.18, you can also use GObject action signals on the tracer object to fetch leak information. Use gst_tracing_get_active_tracers to get a list of all active tracers and find the right one by name.

If the GST_LEAKS_TRACER_SIG env variable is defined, you can use the following POSIX signals to interact with the leaks tracer:

  • SIGUSR1: log alive objects
  • SIGUSR2: create a checkpoint and print a list of objects created and destroyed since the previous checkpoint.

You can activate this tracer in the usual way by adding the string 'leaks' to the environment variable GST_TRACERS. Such as: GST_TRACERS=leaks

Note that the values are separated by semicolon (;), such as: GST_TRACERS=leaks;latency, and multiple instances of the same tracer can be active at the same time.

The tracer properties can also be set to each tracer by passing the object properties in the list of parameters to the tracer. This uses the same serialization format as GstStructure (without a name).

Examples:

GST_TRACERS='leaks(filters="GstEvent,GstMessage",stack-traces-flags=none)'
GST_TRACERS='leaks(filters="GstBuffer",stack-traces-flags=full,check-refs=true);leaks(name=all-leaks)'

The results of the search are