<div dir="ltr"><div><div><div>Hello,<br><br></div>first of all, ensure that you are checking memory correctly. I doubt if MemFree substracts memory used by cache/buffers which is occupied at the moment but can be easily freed by the system. For instance, free command shows that in the second row:<br><br>$ free<br>             total       used       free     shared    buffers     cached<br>Mem:       4045936    3538900     507036      10644     298020    2175820<br>-/+ buffers/cache:    1065060    <b>2980876</b><br>Swap:      1950716       7664    1943052<br><br></div>If you still think that its GStreamer eating memory, it's likely a bug, and you have to fill a bug report.<br><br></div>Marcin<br><div><div> <br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-12 16:38 GMT+01:00 hzhong <span dir="ltr"><<a href="mailto:hongbo.zhong@ivicar.cn" target="_blank">hongbo.zhong@ivicar.cn</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
How to recovery the system free memory after I stop the record pipeline.<br>
<br>
I am using the following step to check the system free memory and create a pipline to record the video stream.<br>
The system free memory will decrease after the pipline running.<br>
<br>
But when I stop the pipline, The system memory could not be recovery to the origin memory state. After I delete<br>
the record file, The system memory can be recovery.<br>
<br>
1. X86:<br>
(1) Test enviroment:<br>
OS Enviroment: Ubuntu 14.04.4<br>
Gstreamer Version: GStreamer 1.6.3<br>
<br>
(2) Check the free memory script(The script name is test.sh) :<br>
#!/bin/sh<br>
<br>
while :<br>
do<br>
        cat /proc/meminfo | grep MemFree<br>
        sleep  5<br>
done<br>
<br>
<br>
(3) Test step<br>
The fist step: Running the test.sh to check the system free memory<br>
The next step: Running the record command as the following:<br>
gst-launch-1.0 videotestsrc ! video/x-raw,format=UYVY,width=640,hight=480 ! videoconvert ! video/x-raw,format=I420 ! x264enc ! avimux ! filesink location=./test.avi<br>
<br>
(4) Test Result:<br>
When The pipeline is running, The system free memory will be decreased.<br>
MemFree:          293064 kB<br>
MemFree:          231984 kB<br>
MemFree:          226280 kB<br>
MemFree:          220780 kB<br>
MemFree:          215340 kB<br>
MemFree:          222788 kB<br>
MemFree:          217228 kB<br>
MemFree:          211908 kB<br>
MemFree:          206048 kB<br>
MemFree:          200344 kB<br>
MemFree:          194796 kB<br>
MemFree:          188904 kB<br>
MemFree:          183448 kB<br>
MemFree:          177868 kB<br>
MemFree:          172072 kB<br>
MemFree:          166212 kB<br>
MemFree:          160756 kB<br>
MemFree:          166684 kB<br>
MemFree:          161036 kB<br>
MemFree:          159176 kB<br>
MemFree:          145444 kB<br>
<br>
After I stop the pipeline(Using ctrl + c), the free memory will increase something. But it could not to recovery it.<br>
MemFree:          200084 kB<br>
MemFree:          199804 kB<br>
MemFree:          203276 kB<br>
MemFree:          199844 kB<br>
MemFree:          200084 kB<br>
MemFree:          200044 kB<br>
<br>
<br>
After I delete the record file(test.avi), The system free memory can be recovery.<br>
MemFree:          199968 kB<br>
MemFree:          312332 kB<br>
MemFree:          312288 kB<br>
<br>
<br>
2. For ARM platform<br>
Freescale imx6q:<br>
gst-launch-1.0 videotestsrc ! video/x-raw,format=UYVY,width=640,hight=480 ! videoconvert ! video/x-raw,format=I420 ! imxvpuenc_h264 ! avimux ! filesink location=./test.avi<br>
<br>
Test Result:<br>
When the pipeline is running, The system free memory state:<br>
MemFree:          744920 kB<br>
MemFree:          744600 kB<br>
MemFree:          736352 kB<br>
MemFree:          731656 kB<br>
MemFree:          726316 kB<br>
MemFree:          721024 kB<br>
MemFree:          715908 kB<br>
MemFree:          711088 kB<br>
MemFree:          705872 kB<br>
MemFree:          700204 kB<br>
MemFree:          695028 kB<br>
MemFree:          689984 kB<br>
MemFree:          684784 kB<br>
MemFree:          683872 kB<br>
MemFree:          683772 kB<br>
MemFree:          678640 kB<br>
MemFree:          673712 kB<br>
MemFree:          668380 kB<br>
MemFree:          663100 kB<br>
MemFree:          657808 kB<br>
MemFree:          652732 kB<br>
MemFree:          647516 kB<br>
MemFree:          642316 kB<br>
MemFree:          641476 kB<br>
... ... ... ... ... ...<br>
MemFree:          252860 kB<br>
MemFree:          252812 kB<br>
MemFree:          252860 kB<br>
MemFree:          252844 kB<br>
MemFree:          252796 kB<br>
MemFree:          252876 kB<br>
MemFree:          252876 kB<br>
MemFree:          252876 kB<br>
MemFree:          252868 kB<br>
MemFree:          252836 kB<br>
MemFree:          252884 kB<br>
MemFree:          252744 kB<br>
MemFree:          252812 kB<br>
MemFree:          252736 kB<br>
MemFree:          252736 kB<br>
MemFree:          252624 kB<br>
MemFree:          252672 kB<br>
MemFree:          252704 kB<br>
MemFree:          252516 kB<br>
MemFree:          575392 kB<br>
<br>
After I delete the record file(test.avi), The free memory can be recovery to the original state.<br>
MemFree:          743300 kB<br>
MemFree:          743416 kB<br>
MemFree:          743408 kB<br>
MemFree:          743220 kB<br>
MemFree:          743284 kB<br>
<br>
Thanks,<br>
Hongbo<br>
<br>
<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>