<div dir="ltr">An awesome reply.<br>Makes sense!<br><br>Thanks.<br><br><br><br><br><div class="gmail_quote">On Tue, Aug 19, 2008 at 9:42 AM, David Dyer-Bennet <span dir="ltr"><<a href="mailto:dd-b@dd-b.net">dd-b@dd-b.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>
On Tue, August 19, 2008 11:31, ABBAS KHAN wrote:<br>
> As by the time, I've learned that Linux works by caching apps by using a<br>
> lot<br>
> of RAM and then it reallocates the new stuff by cleaning the old cached<br>
> pages from memory as compared to other OSs. With 2 gigs of RAM often I see<br>
> the free memory only as 100-400MB. Using TOP or PS, it doesn't look like<br>
> any<br>
> program or process is using excessive memory (the highest process is seen<br>
> with 1-2% total memory). *So, my questions are:*<br>
><br>
>  what programs are using that much of memory? (or cached memory)<br>
<br>
</div>It's very likely being used as disk cache.  You can get some more numbers<br>
by running top, and looking at the last two lines of the headers.  I<br>
routinely see over 1GB of cache on a not very active 4GB system.  Your<br>
meminfo output is the same numbers, and looks completely normal to me.<br>
<br>
Free memory is *bad*; it means it's being wasted completely.  Memory used<br>
for disk caching is instantly available if it's suddenly needed for a<br>
program.<br>
<div class="Ih2E3d"><br>
> Is that really due to a lot of cache in the memory<br>
> *if yes, then, is there a way to parse the cache to findout what<br>
</div>> applications are eating up the cache?*<br>
<br>
It's only indirectly tied to an application; it's cached disk blocks.  You<br>
could say the process that read that file last is responsible, but the<br>
*next* process to read those blocks is the one that would benefit.<br>
<br>
> *how to free the cached memory?*<br>
<br>
Why do you want to?  As I said, "free" memory is memory that's going to<br>
waste.  Unless you have severe real-time issues with a process becoming<br>
runnable where the difference between discarding a clean cached page, and<br>
just allocating a free page, will make a difference, there's no point.  If<br>
you DO have that level really extreme real-time performance issues, you<br>
need to understand the whole virtual memory system an order of magnitude<br>
better than you seem to.  That's off in a far corner of the Linux<br>
application space -- Linux can do some real-time stuff, but it's not the<br>
first choice for hard real-time environments last time I talked to any of<br>
those people.<br>
<br>
--<br>
David Dyer-Bennet, <a href="mailto:dd-b@dd-b.net">dd-b@dd-b.net</a>; <a href="http://dd-b.net/" target="_blank">http://dd-b.net/</a><br>
Snapshots: <a href="http://dd-b.net/dd-b/SnapshotAlbum/data/" target="_blank">http://dd-b.net/dd-b/SnapshotAlbum/data/</a><br>
Photos: <a href="http://dd-b.net/photography/gallery/" target="_blank">http://dd-b.net/photography/gallery/</a><br>
Dragaera: <a href="http://dragaera.info" target="_blank">http://dragaera.info</a><br>
<br>
_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</blockquote></div><br></div>