LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   About the top command output (https://www.linuxquestions.org/questions/linux-general-1/about-the-top-command-output-740659/)

jacobselvin 07-16-2009 09:09 PM

About the top command output
 
According to http://www.linuxmanpages.com/man1/top.1.php the

q: RES -- Resident size (kb)
The non-swapped physical memory a task has used.

RES = CODE + DATA.

But I have the following output

top - 11:44:39 up 16 days, 1:42, 16 users, load average: 0.10, 0.07, 0.06
Tasks: 2 total, 0 running, 2 sleeping, 0 stopped, 0 zombie
Cpu(s): 4.0% us, 4.7% sy, 0.0% ni, 91.0% id, 0.2% wa, 0.0% hi, 0.2% si
Mem: 16406944k total, 10031044k used, 6375900k free, 433872k buffers
Swap: 8385888k total, 160968k used, 8224920k free, 6653228k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP CODE DATA COMMAND
25704 acct 15 0 140m 94m 4712 S 9.7 0.6 1:23.71 46m 5744 131m appli


Clearly RES (94MB) != CODE (6MB) + DATA (131MB).

So the linuxmanpages.com is wrong right? In my opinion the data could be swapped out and the above formula is shouldn't work. Some one please explain me how this works? I'm bit lost.
























































top - 11:49:29 up 16 days, 1:47, 16 users, load average: 1.19, 0.67, 0.29
Tasks: 2 total, 0 running, 2 sleeping, 0 stopped, 0 zombie
Cpu(s): 14.2% us, 14.9% sy, 0.0% ni, 70.4% id, 0.2% wa, 0.1% hi, 0.2% si
Mem: 16406944k total, 10379600k used, 6027344k free, 434324k buffers
Swap: 8385888k total, 160968k used, 8224920k free, 6972716k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ CODE DATA COMMAND
25704 glnse 16 0 72844 24m 4712 S 8.3 0.2 0:17.46 5744 61m p10
25717 glnse 16 0 8980 6256 2548 S 3.3 0.0 0:06.43 2548 3928 slev5nse

























































top - 12:02:09 up 16 days, 2:00, 16 users, load average: 1.22, 1.36, 0.91
Tasks: 2 total, 0 running, 2 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.0% us, 15.8% sy, 0.0% ni, 71.1% id, 0.0% wa, 0.0% hi, 0.1% si
Mem: 16406944k total, 11662812k used, 4744132k free, 436116k buffers
Swap: 8385888k total, 160968k used, 8224920k free, 8162624k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP CODE DATA COMMAND
25704 glnse 15 0 119m 72m 4712 S 9.7 0.5 1:12.42 46m 5744 110m p10
25717 glnse 15 0 15580 12m 2548 S 3.0 0.1 0:36.47 2764 2548 10m slev5nse

Disillusionist 07-17-2009 12:16 AM

Judging from your output:

VIRT = RES + SWAP = DATA + CODE + SHR

Suggesting that the man page may well be wrong.

Having said that, that doesn't always add up either.
It definitely doesn't add up on my system!


All times are GMT -5. The time now is 05:58 PM.