Re: [SLUG] SIZE vs RSS in top(1)

From: Andrew M Hoerter (amh@pobox.com)
Date: Mon Sep 15 2003 - 13:20:18 EDT


On Mon, 15 Sep 2003, btt wrote:

> I see... so does this also include functions in shared libraries? Like
> if libc.so is already in memory for another process, then do all other
> processes that use libc share the memory addresses of the various
> functions in libc? And are the sizes of the shared functions included
> in a processes SIZE? Or is the whole libc's size included? Does that
> even make sense? :p

Actually, to be honest, I'm not sure how shared library usage is
calculated in Linux (I know more about Solaris and BSD internals).

To be sure, there's only one copy of a shared library in RAM at a time,
and various processes map that copy into their address space. It seems
that Linux top/ps have a SHARE or SHR statistic, which might represent
what fraction of your RSS consists of shared mappings. Just a random
guess, but that theory does seem to jive with what I see on a couple Linux
boxes here. <shrug>

Solaris has a neat command called pmap(1) that will give you the low-down
on the address space mappings for a given process. Don't know if Linux
has anything equivalent.

> Yeah, I have a mysql process that's using like 81,000 SIZE, but like
> 6,000 RSS.

That's probably a file being mmap()'ed by MySQL. Since the backing store
for that mapping is a file, it doesn't take any physical RAM (this isn't
true under all circumstances though).

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:42:54 EDT