How to recovery the system free memory after I stop the record pipeline

marcin at saepia.net marcin at saepia.net
Sat Mar 12 19:37:27 UTC 2016


Hello,

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:

$ free
             total       used       free     shared    buffers     cached
Mem:       4045936    3538900     507036      10644     298020    2175820
-/+ buffers/cache:    1065060    *2980876*
Swap:      1950716       7664    1943052

If you still think that its GStreamer eating memory, it's likely a bug, and
you have to fill a bug report.

Marcin


2016-03-12 16:38 GMT+01:00 hzhong <hongbo.zhong at ivicar.cn>:

> Hi
>
> How to recovery the system free memory after I stop the record pipeline.
>
> I am using the following step to check the system free memory and create a
> pipline to record the video stream.
> The system free memory will decrease after the pipline running.
>
> But when I stop the pipline, The system memory could not be recovery to
> the origin memory state. After I delete
> the record file, The system memory can be recovery.
>
> 1. X86:
> (1) Test enviroment:
> OS Enviroment: Ubuntu 14.04.4
> Gstreamer Version: GStreamer 1.6.3
>
> (2) Check the free memory script(The script name is test.sh) :
> #!/bin/sh
>
> while :
> do
>         cat /proc/meminfo | grep MemFree
>         sleep  5
> done
>
>
> (3) Test step
> The fist step: Running the test.sh to check the system free memory
> The next step: Running the record command as the following:
> 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
>
> (4) Test Result:
> When The pipeline is running, The system free memory will be decreased.
> MemFree:          293064 kB
> MemFree:          231984 kB
> MemFree:          226280 kB
> MemFree:          220780 kB
> MemFree:          215340 kB
> MemFree:          222788 kB
> MemFree:          217228 kB
> MemFree:          211908 kB
> MemFree:          206048 kB
> MemFree:          200344 kB
> MemFree:          194796 kB
> MemFree:          188904 kB
> MemFree:          183448 kB
> MemFree:          177868 kB
> MemFree:          172072 kB
> MemFree:          166212 kB
> MemFree:          160756 kB
> MemFree:          166684 kB
> MemFree:          161036 kB
> MemFree:          159176 kB
> MemFree:          145444 kB
>
> After I stop the pipeline(Using ctrl + c), the free memory will increase
> something. But it could not to recovery it.
> MemFree:          200084 kB
> MemFree:          199804 kB
> MemFree:          203276 kB
> MemFree:          199844 kB
> MemFree:          200084 kB
> MemFree:          200044 kB
>
>
> After I delete the record file(test.avi), The system free memory can be
> recovery.
> MemFree:          199968 kB
> MemFree:          312332 kB
> MemFree:          312288 kB
>
>
> 2. For ARM platform
> Freescale imx6q:
> 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
>
> Test Result:
> When the pipeline is running, The system free memory state:
> MemFree:          744920 kB
> MemFree:          744600 kB
> MemFree:          736352 kB
> MemFree:          731656 kB
> MemFree:          726316 kB
> MemFree:          721024 kB
> MemFree:          715908 kB
> MemFree:          711088 kB
> MemFree:          705872 kB
> MemFree:          700204 kB
> MemFree:          695028 kB
> MemFree:          689984 kB
> MemFree:          684784 kB
> MemFree:          683872 kB
> MemFree:          683772 kB
> MemFree:          678640 kB
> MemFree:          673712 kB
> MemFree:          668380 kB
> MemFree:          663100 kB
> MemFree:          657808 kB
> MemFree:          652732 kB
> MemFree:          647516 kB
> MemFree:          642316 kB
> MemFree:          641476 kB
> ... ... ... ... ... ...
> MemFree:          252860 kB
> MemFree:          252812 kB
> MemFree:          252860 kB
> MemFree:          252844 kB
> MemFree:          252796 kB
> MemFree:          252876 kB
> MemFree:          252876 kB
> MemFree:          252876 kB
> MemFree:          252868 kB
> MemFree:          252836 kB
> MemFree:          252884 kB
> MemFree:          252744 kB
> MemFree:          252812 kB
> MemFree:          252736 kB
> MemFree:          252736 kB
> MemFree:          252624 kB
> MemFree:          252672 kB
> MemFree:          252704 kB
> MemFree:          252516 kB
> MemFree:          575392 kB
>
> After I delete the record file(test.avi), The free memory can be recovery
> to the original state.
> MemFree:          743300 kB
> MemFree:          743416 kB
> MemFree:          743408 kB
> MemFree:          743220 kB
> MemFree:          743284 kB
>
> Thanks,
> Hongbo
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160312/0c696efc/attachment.html>


More information about the gstreamer-devel mailing list