<div dir="ltr"><div><div><div><div><div><div><div>First things first: What is "Used Memory" in Linux?<br><br></div>Most people think that "Used Memory" means "used by my running applications". <br>
<br>When Linux says "used", it means "used for any purpose", and furthermore, "used" does NOT mean "total - available for applications". So what one sees as "free" does not mean that's the amount of memory available for applications. It can, and usually is, a much higher number.<br>
<br>In Linux, everything in use, including by the kernel, for purposes of caches and buffers, i<i>s</i> ALSO "used", but, when memory is needed by applications, these buffers and caches can, and are, being discarded (after all, they're cache, they don't contain anything not written elsewhere, e.g. on disk). Usually very little buffers would not be on the disk - such ones cannot be reclaimed as free memory before they're flushed.<br>
<br></div>So, one should add 'cached' and 'buffers' from 'top' to be considered as the 'free memory pool', and not take the 'free' number as the real free memory. Linux, in its way of operation, will always have a growing and growing 'cached' value. This is OK, by design, and part of the thing that makes it so fast. When RAM is needed, cache is evicted. There are a few examples for this on <a href="http://www.linuxatemyram.com">www.linuxatemyram.com</a><br>
<br></div>Now, there are a few other places where RAM can be taken, which do not count towards 'cached', even though they're cache. There's the SLAB. You can examine it by running cat /proc/slabinfo (as root). There's even a top-like utility for it: slabtop(1).<br>
<br></div>Some of the Slab is reclaimable for use (you can 'grep Reclaim /proc/meminfo '), some is not. Likely lots of Slab would be for dentry cache, especially if you're opening many many files. Some buggy-designed software does this (for example nss... which is unfortunately used by default in cURL SSL connections if you've not compiled cURL to use OpenSSL instead...). See: <a href="https://www.splyt.com/blog/2014-05-16-optimizing-aws-nss-softoken">https://www.splyt.com/blog/2014-05-16-optimizing-aws-nss-softoken</a><br>
<br></div>I would also appreciate others insights on the subject :)<br><br></div>HTH,<br><br></div>-- Shimi<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 29, 2014 at 11:41 AM, Omer Zak <span dir="ltr"><<a href="mailto:w1@zak.co.il" target="_blank">w1@zak.co.il</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a 8GB PC which runs Linux Debian Jessie with KDE 4.4.<br>
My problem is to find out who is occupying almost 4GB memory some time<br>
after rebooting, even when nothing heavy is running.<br>
<br>
The heaviest applications that I run are:<br>
- A VirtualBox virtual machine occupying 3GB memory<br>
- Google Chrome browser (version 37.0.2062.94, 64-bit)<br>
- Evolution 3.12.2.<br>
<br>
However, even when they are closed, a lot memory is still reported to be<br>
in use.<br>
<br>
My question is: besides top, what tools can be used to find who is using<br>
all this memory?<br>
The next question, of course, is how to get rid of those memory hogs<br>
without destabilizing the system.<br>
<br>
--- Omer<br>
<br>
--<br>
More proof the End of the World has started. Just saw this online:<br>
I think it's beginning! Ten minutes ago there was a group of people<br>
waiting at the bus stop outside my house. Now, they're all gone!<br>
My own blog is at <a href="http://www.zak.co.il/tddpirate/" target="_blank">http://www.zak.co.il/tddpirate/</a><br>
<br>
My opinions, as expressed in this E-mail message, are mine alone.<br>
They do not represent the official policy of any organization with which<br>
I may be affiliated in any way.<br>
WARNING TO SPAMMERS: at <a href="http://www.zak.co.il/spamwarning.html" target="_blank">http://www.zak.co.il/spamwarning.html</a><br>
<br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</blockquote></div><br></div>