pulsedeviceprovider keep increasing ref count during each NULL->PLAYING state of pipeline and also found 4KB memory increase in VmRSS
With below attach reference code I am trying to simulate my actual usecase.
Usecase : Need to monitor the pulseaudio device and change the state of pipeline either PLAYING or NULL based on device monitor GST_MESSAGE_DEVICE_ADDED
and GST_MESSAGE_DEVICE_REMOVED
events respectively.dev_monitor_test.c
In example code, I have remove pulsesrc dependency and just used audiotestsrc as of now. audiotestsrc will provide data to fakesink once my pulseaudiodevice is added and state of pipeline goes to PLAYING and during remove time pipeline state set to NULL.
It is observed that there is a 4KB memory increase within 6-7 iteration of device ADDED/REMOVED (or PALYING/NULL pipeline). After checking with LEAK TRACE not found anything related to leakage. As a last option I have start using GST_DEBUG=GST_REFCOUNTING
with my binary and found that pulsedeviceprovider0
object keep increasing the reference counts. All increased pulsedeviceprovider0
reference counts windup at the time of application termination but during application alive time and provide device ADDED/REMOVE event is contributing 4KB memory increase in VmRSS.
Have start looking into https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/blob/master/ext/pulse/pulsedeviceprovider.c but to make this fast I raise this issue(I don't know whether this is really a bug or not because at terminatio time all ref count is setback to 0 and object itself is dispose but with my usecase 4KB is increasing may be due to pulsedeviceprovider I guess).
ref count log is attached.pulsedeviceprovider_keep_increase_ref_count_until_terminate.txt