I've been trying to track down a memory leak in our system.
We have an iMX6 solo (512MB of RAM) that's intended to play video clips when the system is in "Idle" mode (not being used by a customer). We're currently playing a small video in a loop (.mov, less than 1MB in size, plays for less than 10 seconds) after a period of time when there is no touchscreen activity detected.
We're currently using Qt 5.5 (Enterprise) for our user interface as well as handling multimedia.
We noticed that if we let our video loop continuously for extended periods of time (> 24 hours) that, eventually, our system will crash because the 'OOM' kicks in and reports that there is not enough system memory.... it kills our application.
I decided to start a thread in our system that goes out (about once every 5 seconds) and captures all the information stored in '/proc/meminfo'. I could see that the memory was slowly leaking away over time. I could also see that "Commited_AS" continued to grow over time.
After combing through the community, I found several helpful suggestions but nothing that eliminates this memory leak.
One thing I have implemented in our system, as recommended within the community, is a thread that runs in the background that writes a "3" to '/proc/sys/vm/drop_caches'. This really only helped to prolong the inevitable. The system memory still appears to leak away but at a much lower rate.
I imported my log file, graphed the free memory and captured it to share. Around the '33526' mark in this graph, the 'OOM' kicked in and killed our application. I thought this seemed strange until I saw how high 'Commited_AS' had climbed.
Can anybody offer any advice on what I can change in the system to eliminate this memory leak error?
Any advice would be greatly appreciated.
已解决! 转到解答。
Yuri,
Thanks for your attention to this.
It turns out that the problem resides within the BSP that our vendor was providing.
We've been doing testing with Freescale's latest BSP and are seeing MUCH better results now.
We're going to work with the vendor to integrate the "latest and greatest" BSP.
Thank you again.
-Bob
Yuri,
Thanks for your attention to this.
It turns out that the problem resides within the BSP that our vendor was providing.
We've been doing testing with Freescale's latest BSP and are seeing MUCH better results now.
We're going to work with the vendor to integrate the "latest and greatest" BSP.
Thank you again.
-Bob
Hello,
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.
Also, from the next thread :
"[i.MX6]memory leak of Gstreamer"
https://community.freescale.com/thread/333860
"... we try to perform
$ echo 1 >/proc/sys/vm/drop_caches
by the script of while [1] in playing video. The memory will not rise continuously
and can play video normally."
Have a great day,
Yuri
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
There are tools for avoiding file caching of a specific application like the
pagecache-management (https://code.google.com/p/pagecache-mangagement/)
This is an open source project NOT maintained and NOT supported by Freescale,
which could anyway help in the intent.
Regards,
Yuri.