Who is leaking memory in my Linux Jessie/KDE4 installation?

Who is leaking memory in my Linux Jessie/KDE4 installation?

shimi linux-il at shimi.net
Fri Aug 29 12:58:09 IDT 2014


First things first: What is "Used Memory" in Linux?

Most people think that "Used Memory" means "used by my running
applications".

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.

In Linux, everything in use, including by the kernel, for purposes of
caches and buffers, i*s* 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.

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 www.linuxatemyram.com

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).

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:
https://www.splyt.com/blog/2014-05-16-optimizing-aws-nss-softoken

I would also appreciate others insights on the subject :)

HTH,

-- Shimi


On Fri, Aug 29, 2014 at 11:41 AM, Omer Zak <w1 at zak.co.il> wrote:

> I have a 8GB PC which runs Linux Debian Jessie with KDE 4.4.
> My problem is to find out who is occupying almost 4GB memory some time
> after rebooting, even when nothing heavy is running.
>
> The heaviest applications that I run are:
> - A VirtualBox virtual machine occupying 3GB memory
> - Google Chrome browser (version 37.0.2062.94, 64-bit)
> - Evolution 3.12.2.
>
> However, even when they are closed, a lot memory is still reported to be
> in use.
>
> My question is: besides top, what tools can be used to find who is using
> all this memory?
> The next question, of course, is how to get rid of those memory hogs
> without destabilizing the system.
>
> --- Omer
>
> --
> More proof the End of the World has started. Just saw this online:
> I think it's beginning! Ten minutes ago there was a group of people
> waiting at the bus stop outside my house. Now, they're all gone!
> My own blog is at http://www.zak.co.il/tddpirate/
>
> My opinions, as expressed in this E-mail message, are mine alone.
> They do not represent the official policy of any organization with which
> I may be affiliated in any way.
> WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html
>
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20140829/3575cc1d/attachment.html>


More information about the Linux-il mailing list