Following on from this question. Debian, if that matters.
I understand that some memory is shared between forked processes. How then can I determine how much memory is used by a process/set of forked processes?
Using the smem tool recommended in this similar question, I get values like:
Command Swap USS PSS RSS
/usr/sbin/spamd --create-pr 0 16820 24974 41628
spamd chil 0 19388 27581 44176
spamd chil 0 32328 40038 55708
I understand the swap column, and the RSS column is what is normally reported (e.g. in ps). From reading the smem documentation, it sounds like USS is the memory specifically for that child, and PSS is a portion of the memory shared across the processes. However, adding USS to PSS gives higher values than RSS, and I thought that the sharing would mean less (so I'm presumably interpreting incorrectly).
I'm not tied to the smem tool. I would just like some way of getting a "memory use" number that somewhat accurately reflects the amount of real memory that the process is using.