[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-devel
Subject:    Release RAM, when close or reload stream
From:       Deymos s via gstreamer-devel <gstreamer-devel () lists ! freedesktop ! org>
Date:       2024-04-17 12:59:15
Message-ID: CAMi4ONH0_53oy_JHrETLdPDNwMpWV2P6eVP6MssYUY_m5gN5qw () mail ! gmail ! com
[Download RAW message or body]

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.
Example: https://github.com/Deymoss/Rtsp-player

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)

How to properly clear the memory and all information about the stream when
closing?

At the moment I'm setting the pipeline to NULL and not making an unref, but
if I uncomment these lines:

gst_bus_set_sync_handler(m_videoPipe->bus, nullptr, nullptr,
nullptr);gst_object_unref(m_videoPipe->pipeline);gst_object_unref(m_videoPipe->bus);

nothing changes in memory consumption, although the refcount of each
element and the pipeline itself at the end of the function is zero.

[Attachment #3 (text/html)]

<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&#39;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-&gt;bus, \
<span>nullptr</span>, <span>nullptr</span>, <span>nullptr</span>); \
<span>gst_object_unref</span>(m_videoPipe-&gt;pipeline); \
<span>gst_object_unref</span>(m_videoPipe-&gt;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>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic