LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 05-22-2011, 08:59 AM   #1
mappux
LQ Newbie
 
Registered: Sep 2010
Location: Germany
Distribution: Debian Squeeze
Posts: 8

Rep: Reputation: 0
[Solved] Looking for help with output of the top command


Hallo,

although I've been using Linux for a while now, I still have some questions and I hope that anyone here can help me.

At the moment I'm trying to figure out how to read the output of the
"top" command correctly.

The CPU has

address sizes : 32 bits physical, 32 bits virtual
cpu MHz : 1729.130
cache size : 1024 KB

Sometimes the system got rather slow, so I wanted to know which processes eat up the memory.

When the system got slow, the output of "top" looked something like this:
Code:
Tasks: 185 total,   1 running, 184 sleeping,   0 stopped,   0 zombie
Cpu(s): 93.4%us,  5.0%sy,  1.7%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1025128k total,  1011160k used,    13968k free,    97164k buffers
Swap:        0k total,        0k used,        0k free,   501976k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND

12942 user1     20   0 42760  33m 6308 S 82.6  3.3   0:18.15 virtuoso-t
12937 user1     20   0  106m  15m  12m S  6.3  1.5   0:01.90 nepomukservices
12948 user1     39  19 80400  21m  17m S  3.6  2.2   0:01.07 nepomukservices
 2051 user1     20   0  2908 1072  496 S  1.7  0.1   0:00.96 dbus-daemon
12951 user1     20   0 44956  11m 9996 S  1.3  1.1   0:00.24 nepomukservices
12953 user1     20   0 37420  12m  10m S  1.3  1.2   0:00.32 nepomukservices
12949 user1     20   0 43200  13m  10m S  1.0  1.4   0:00.68 nepomukservices
 1377 root      20   0 81500  22m 4616 S  0.3  2.2   3:54.28 Xorg
 2137 root      20   0 83792 9116 5580 S  0.3  0.9   0:17.38 x-terminal-emul
 6676 user1     20   0 84800  12m 8988 S  0.3  1.2   1:17.18 lxpanel
12960 root      20   0  2464 1216  896 R  0.3  0.1   0:00.08 top
    1 root      20   0  2032  160   68 S  0.0  0.0   0:01.06 init
Now I'd like some help in reading this.

My first assumption was that k meant Kilobytes, but if this refers to the cpu memory, there's a difference of the factor 1000.

Section 2 of "man top" tells me only that k is something with kernel, but I assume that this in another context. m is explained as something with time, but this also does not fit in here.

So my questions in short:

1. What's the meaning of letters m and k?
2. Why is the mem value 1025128k and not something like
1048576 Bytes or 1024000 Bytes?
3. Why are sleeping processes using so much of resident memory?

Last edited by mappux; 05-22-2011 at 01:18 PM.
 
Old 05-22-2011, 09:08 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
1) m means Megabytes, k means kilobytes
2) Because the memory values listed under the Cpu(s) line are measuring physical memory, i.e. RAM.
3) Because they are currently sleeping doesn't mean they release the memory instantly.

The descriptions in man top regarding m and k are relating to sorting options for the display.

Last edited by smoker; 05-22-2011 at 09:11 AM.
 
Old 05-22-2011, 11:09 AM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by mappux View Post
3. Why are sleeping processes using so much of resident memory?
Whether a process is storing something in memory has nothing whatsoever to do with its CPU usage.

For example, you might have a text editor with a huge file opened in it, but you aren't editing it at the moment.
 
Old 05-22-2011, 01:17 PM   #4
mappux
LQ Newbie
 
Registered: Sep 2010
Location: Germany
Distribution: Debian Squeeze
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you very much for the fast help, both of you.

Then my first assumption for k was right, but my guess that the second line would refer
to the cpu cache was wrong, if mem means ram.

So the processes I listed occupied just about 15% of ram together, but virtuoso was using
most of the cpu time in the measured interval and was just accidentally sleeping at the
time the "snapshot" was made.

Maybe I should study the renice command next.
 
  


Reply



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
top command output in "human readable" custangro Linux - General 7 12-01-2017 11:53 AM
No output from top command run by crontab Gr1f1S Linux - Newbie 5 04-23-2013 05:47 AM
About the top command output jacobselvin Linux - General 1 07-17-2009 12:16 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

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

All times are GMT -5. The time now is 05:22 AM.

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