<div dir="ltr"><p>I am developing a video wall for 32-64 streams, I faced the problem of increasing memory when restarting streams
I have an example illustrating my problem.<br>
Example: <a href="https://github.com/Deymoss/Rtsp-player" rel="nofollow noreferrer" target="_blank">https://github.com/Deymoss/Rtsp-player</a></p>
<p>When I start the application, a pipeline is created, as a result, the
 application initially takes 54MB of RAM, when I start the stream, the 
volume increases to ~ 110 MB, when I close the stream, the memory is not
 freed, when I run the same stream again, the amount of RAM increases to
 120 MB, and so on, 36 streams eats 5 gb RAM for 12 hours, the same is true for file files descriptors (I 
suspect BUS creates them)</p>
<p>How to properly clear the memory and all information about the stream when closing?</p>
<p>At the moment I'm setting the pipeline to NULL and not making an unref, but if I uncomment these lines:</p>
<pre><code><span>gst_bus_set_sync_handler</span>(m_videoPipe->bus, <span>nullptr</span>, <span>nullptr</span>, <span>nullptr</span>);
<span>gst_object_unref</span>(m_videoPipe->pipeline);
<span>gst_object_unref</span>(m_videoPipe->bus);
</code></pre>
<p>nothing changes in memory consumption, although the refcount of each 
element and the pipeline itself at the end of the function is zero.</p></div>