[i.MX6]memory leak of Gstreamer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[i.MX6]memory leak of Gstreamer

Jump to solution
3,111 Views
tongchunyang
Contributor III

Hi, community

As use the playbin2 of gstreamer to play a local video file(Video:1080p/mp4/size:980MB  CMD:gst-launch playbin2 uri=file:///home/username/001.mp4 ) ,
We find that cachedcontinuously rise until the whole physical memory is nearly occupied.
We suspect that video cache occupy the memory continuously, which result in that our other background process cannot obtain the memory.

how can We expect that video cache do not occupy the memory whenever possible or stipulate the size of memory for video cache, when playbin2 play local video smoothly?

■environment

imx6: dual lite

DDR: 512MB * 2

Gstreamer Version:

gst-fsl-plugins-3.0.7

gst-plugins-gl-0.10.3.1

gst-plugins-base0.10_0.10.35

gst-plugins-good0.10_0.10.30

gstreamer0.10_0.10.35

libfslcodec-3.0.7

libfslmscodec-3.0.7

libfslparser-3.0.7

libfslvpuwrap-1.0.35

libfslmsparser-3.0.7

Labels (3)
Tags (1)
0 Kudos
1 Solution
1,430 Views
tongchunyang
Contributor III

Thank you for your reply.

When we play the video, the other process in the background may use cache to read-write the file.

$ echo 1 >/proc/sys/vm/lowmem_reserve_ratio will cause that the processing data will be deleted.

We expect to solve the problems through the following measures:

Limit the maximal size of cache that video can use or only delete the cache video used.

Others, we try to perform $ echo 1 >/proc/sys/vm/drop_caches by the script of while1 in playing video.

The memory will not rise continuously and can play video normally.

Does this mean that it does not actually require a mass of memory for video cache when gstreamer is playing the local video?

Yours Sincerely,

View solution in original post

0 Kudos
3 Replies
1,430 Views
Yuri
NXP Employee
NXP Employee

I remember the following limitation :

   When playing the video for a long time, allocation of contiguous memory may fail

(memory fragmentation).

   To play video when the system memory is low, run the command:

$ echo 1 >/proc/sys/vm/lowmem_reserve_ratio

   It protects the DMA zone and avoids memory allocation errors.

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,431 Views
tongchunyang
Contributor III

Thank you for your reply.

When we play the video, the other process in the background may use cache to read-write the file.

$ echo 1 >/proc/sys/vm/lowmem_reserve_ratio will cause that the processing data will be deleted.

We expect to solve the problems through the following measures:

Limit the maximal size of cache that video can use or only delete the cache video used.

Others, we try to perform $ echo 1 >/proc/sys/vm/drop_caches by the script of while1 in playing video.

The memory will not rise continuously and can play video normally.

Does this mean that it does not actually require a mass of memory for video cache when gstreamer is playing the local video?

Yours Sincerely,

0 Kudos
1,430 Views
Yuri
NXP Employee
NXP Employee

Looks like memory fragmentation is the main issue.
You can try Yocto release, where situation should be – at least – less critical.


~Yuri.