2008-11-18 02:05:30 Memory Freeup issue
Sada M (INDIA)
Message: 65402
Hi,
This is Sada from Jasmin Infotech. We are working on BF533 Blackfin uCLinux environment for a networked music player product for a customer.
We are seeing a strange behavior in the total system free memory available.
Background:
The high-level functionality of the device include downloading data from internet radio servers or a local DLNA server and then playback of the same by a audio decoder running in Blackfin with the CODEC output. The system has the associated network stacks, Audio decoders and drivers running.
The Kernel used is 2007R1.
Issue :
The device connects to a internet Radio server and downloads songs in MP3/WMA format. The downloaded Data is fed to the decoder and decoded resulting in audio output.
We have a test system in which we just download the data alone without the decoding.
We download one song after another. The system is kept running for a long time (1 hour).
There are lot of memory allocation and free happening in the system.
We are seeing that the free memory available in the system is reduced after one hour of playback under this continuous download of one song after another.
If we do the same experiment with a delay of 2 seconds inbetween downloading two Consecutive songs we see the free memory is more or less unchanged.
Could you provide your expert advice on the above.
We do not find any memory leaks in our system though we are verifying that once more. We see that the reduction in free memory could affect the system behaviour and hence We request on how to handle this.
Regards,
Sada
QuoteReplyEditDelete
2008-11-18 02:08:42 Re: Memory Freeup issue
Mike Frysinger (UNITED STATES)
Message: 65403
most likely this is the page cache. you can check by forcing a flush of the page cache via /proc/sys/vm/drop_caches.
if you search the forums, you can find info on page cache tuning for 2007R1 ... but this has largely been deprecated/dropped in the latest release as the common code should handle page reclamation much nicer.
QuoteReplyEditDelete
2008-11-18 03:03:04 Re: Memory Freeup issue
Sada M (INDIA)
Message: 65404
Hi Mike Frysinger,
Thanks for your quick reply.
if you search the forums, you can find info on page cache tuning for 2007R1 ... but this has largely been deprecated/dropped in the latest release as the common code should handle page reclamation much nicer.
You mean theapplication developer has to handle this or it is handled properly/ nice way in the latest kernals 2008 R1.5.
Could you calrify on this ?
QuoteReplyEditDelete
2008-11-18 03:41:41 Re: Memory Freeup issue
Michael Hennerich (GERMANY)
Message: 65405
Sada,
I strongly recommend updating your kernel to 2008R1 from our branch svn.
(and NOT the 2008R1 release tarballs)
In 2007R1 there is a tunable at /proc/sys/vm/pagecache_ratio.
Doing something like
#echo 50 > /proc/sys/vm/pagecache_ratio will reserve 50% of the free memory for page cache.
See more info here:
http://lkml.indiana.edu/hypermail/linux/kernel/0701.2/0426.html
http://lwn.net/Articles/218890/
However using this experimental feature does have some negative side effects – and may cause problems.
In 2008R1 and later Sonic Zhang added a patch that will automatically drop the page cache once the memory pressure gets too high.
Best regards,
Michael
QuoteReplyEditDelete
2008-11-18 22:32:45 Re: Memory Freeup issue
Robin Getz (UNITED STATES)
Message: 65471
Sada:
There is not enough info in your orginal message to know where the problem is. (if it is in the application or in the page cache).
you say that memory is not being freed - how do you know? Are you looking at /proc/meminfo or just the free command?
-Robin
QuoteReplyEditDelete
2008-11-19 02:35:12 Re: Memory Freeup issue
Sada M (INDIA)
Message: 65475
Hi Robin,
We are using free/top command. Should we check using cat/proc/meminfo ?
Regards,
Sada.
QuoteReplyEditDelete
2008-11-19 16:51:26 Re: Memory Freeup issue
Robin Getz (UNITED STATES)
Message: 65558
Sada:
Yes - I would not have suggested it if I didn't want you to do it.
Free will tell you that memory is being less - meminfo will say where it is going.
-Robin