Here are some of the common attributes I figured out:

top(VIRT) , smem(VSS), /proc/pid/statm (1st entry in pages), /proc/pid/status (VmSize), ps(VSZ)

top(RES) , smem(RSS), /proc/pid/statm (2nd entry in pages), /proc/pid/status (VmRSS), add all Rss: values in /proc/pid/smaps process mappings, add all Private_.* + Shared_.* values in /proc/pid/smaps process mappings, ps(RSS)

top(DATA) , not reported by smem, /proc/pid/statm (6th entry in pages), /proc/pid/status (VmData), not reported by ps

top(CODE) , not reported by smem, /proc/pid/statm (4th entry in pages), not reported by /proc/pid/status, not reported by ps

top(SHR) , not reported by smem, /proc/pid/statm (3rd entry in pages), not reported by /proc/pid/status, not reported by ps

smem(USS), add all Private_.* values in /proc/pid/smaps process mappings

smem(PSS), add all Pss: values in /proc/pid/smaps process mappings

smem(Swap), add all Swap: values in /proc/pid/smaps process mappings

top(SWAP) = top(VIRT) - top(RES)

Question: Are there any other relations (as mentioned above) present that I have missed above? Can you share?

closed as not a real question by Gilles, Michael Mrozek Mar 10 '12 at 19:30

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What is your question? – Mat Mar 8 '12 at 23:04
  • Added a note at the end. – abc Mar 8 '12 at 23:06
  • I still don't see a question in there. No, this is not about the lack of a ?. I mean that I don't understand what you expect an answer to consist of. – Gilles Mar 8 '12 at 23:28

The programs ps, top, and smem are all getting their data from /proc. Maybe you'd enjoy looking at the source code to get the exact details. Those details have changed over the years and will probably continue to change.

The smem program is a Python script. Here is the list of fields in smem: http://selenic.com/repo/smem/file/43b299004079/smem#l271

Linux gets top and ps from package procps. Here is the list of fields in top: http://procps.cvs.sourceforge.net/viewvc/procps/procps/top.c?revision=1.134&view=markup#l1223

And here is the list of fields in ps: http://procps.cvs.sourceforge.net/viewvc/procps/procps/ps/output.c?revision=1.65&view=markup#l1286

Not the answer you're looking for? Browse other questions tagged or ask your own question.