# top(1) SIZE vs MEM



## mk (Nov 8, 2010)

Simple question of the day!
`# top -n -o res`

```
last pid:  3009;  load averages:  0.23,  0.29,  0.37  up 0+13:23:53    21:42:59
104 processes: 104 sleeping

Mem: 181M Active, 153M Inact, 721M Wired, 11M Cache, 112M Buf, 676M Free
Swap: 512M Total, 23M Used, 489M Free, 4% Inuse



  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
 1298 karamel      16  44    0   725M   595M select  0 359:23 11.08% VirtualBox
 1223 karamel       1  45    0   346M   325M select  0  27:35  3.08% Xorg
 2921 karamel      13  44    0   158M   117M ucond   0   2:08  0.78% firefox-bin
```

Why SIZE doesn't match Mem field? 

P.S. I'm wondering about this for years..


----------



## Alt (Nov 8, 2010)

link


----------



## mk (Nov 8, 2010)

From top()
SIZE is the  total  size  of  the process  (text, data, and stack), RES is the current amount of resident memory (both SIZE and RES are given in kilobytes)

More clean than the statement in your link, and I don't think that answer my question.


----------



## Alt (Nov 8, 2010)

mk said:
			
		

> SIZE is the  total  size  of  the process  (text, data, and stack)


If this correct, why sum(SIZE) > total mem used ? 
If you cant answer why, this means statement from top(1) is not clear.


----------



## luna (Nov 9, 2010)

I guess RSS displays amount of SIZE currently paged in. And SIZE is not limited to ram + swap, it can be larger.


----------

