LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-16-2009, 09:09 PM   #1
jacobselvin
Member
 
Registered: May 2005
Location: Australia
Distribution: SUSE 10.1
Posts: 62

Rep: Reputation: 15
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
 
Old 07-17-2009, 12:16 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 97
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!

Last edited by Disillusionist; 07-17-2009 at 12:30 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to save top output? 18Googol2 Linux - General 9 03-13-2009 01:22 AM
Output of a C program which contains Linux's TOP command trups8 Programming 8 02-07-2009 06:14 AM
problem with output of ' top -n 1 ' command NoopurTiwari Linux - Newbie 1 05-29-2007 02:45 AM
Output of 'top' as backgrond Burgin Linux - General 2 06-09-2005 05:18 PM
Odd output of 'top' philforrest Linux - General 1 07-20-2004 12:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration