Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It's my htop output:

enter image description here

For example, I'm confused by this ruby script:

enter image description here

How many physical memory is it using? 3+1+8+51+51? 51? 51+51?

share|improve this question
Virtual memory? Physical memory? It's not clear what you're asking. – David Schwartz Jun 21 '13 at 9:00
Sorry, I meant physical memory. – Lai Yu-Hsuan Jun 21 '13 at 9:01
There are two 51's because the process forked. It most likely doesn't consume 102 megabytes because the two processes are each using the same 51 megabytes, but you can't easily tell. The other process RES contains the inner process if that memory is resident in the other process as well and not if it doesn't. The RES fields tells you how much physical memory each process is using, but other processes may (or may not) be using that very same physical memory too. – David Schwartz Jun 21 '13 at 9:16
If you want to know if the two processes are using the same memory, use pmap -d <process id> – Sirch Jun 21 '13 at 9:28
@LaiYu-Hsuan: Yes, you're wrong. The pages aren't copied, they're shared. They're only copied if either process writes to the page, then they have to be unshared. (The is called "copy on write" or "CoW".) – David Schwartz Jun 21 '13 at 10:58

Hide user threads (shift + H) and close the process tree view (F5), then you can sort out the process of your interest by PID and read the RES column (sort by MEM% by pressing shift + M, or F3 to search in cmd line)

share|improve this answer
Shift-H is what I've been looking for for ages. Thanks! – a paid nerd Jan 19 '15 at 23:24

Memory is a hard thing, you cannot calculate used physical memory by just running ps/htop/top. Memory can be shared between processes.

I recommend you to check usage with this script:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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