Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

htop multiple entries?

1,493 views
Skip to first unread message

Jim Beard

unread,
Mar 30, 2008, 9:43:02 AM3/30/08
to
Dave Hodgins' recent mention of htop prompted me to install it,
and results have been surprising. As root, ps -eF yields (a few
moments ago) 146 processes, but htop says there are 194.

Command ps -eF shows one entry for console-kit-daemon.
[root@jb jim]# ps -eF |grep console
root 4003 1 0 25189 3328 0 Mar28 ? 00:00:00
/usr/sbin/console-kit-daemon

Command htop shows about 50 repetitions, differing only in pid.
/* Cut & paste from htop under Eterm is not working */

For a less dramatic example,
[root@jb jim]# ps -eF |grep amarok
jim 6878 1 2 164695 77348 0 08:46 ? 00:00:58 amarokapp
jim 6895 6878 0 4397 3316 0 08:46 ? 00:00:00 ruby
/usr/share/apps/amarok/scripts/score_default/score_default.rb
root 7552 7292 0 1822 808 1 09:27 pts/2 00:00:00 grep
--color amarok

htop shows 11 instances of amarokapp, with the cpu% number
changing every few seconds for about half of them. Similar
examples for other processes abound.

Is this standard behavior? A bug? My wag is that the process
#s for the duplicated entries were once used by the process but
are dead, yet htop is picking them up. If so, why is cpu% time
being rotated among them?

I am running kernel 2.6.24.4-desktop-1mnb as part of 2008.1 rc2
on my 64-bit AMD/nForce 410 system, but I fail to see how that would
affect this behavior.

Cheers!

jim b.

--
UNIX is not user-unfriendly; it merely
expects users to be computer-friendly.

David W. Hodgins

unread,
Mar 30, 2008, 12:58:47 PM3/30/08
to
On Sun, 30 Mar 2008 09:43:02 -0400, Jim Beard <jim....@verizon.net> wrote:

> Command htop shows about 50 repetitions, differing only in pid.

A little confusing, and cluttering, isn't it. :)

While the process numbers are shown, htop is only able to get the memory
usage for all of the threads combined, and each process shows the total
memory usage for all of the threads.

> /* Cut & paste from htop under Eterm is not working */

That's because the screen is being redrawn in between selecting the
text, and copying it. There is nothing on the man page for htop, on
controlling the delay, however htop --help shows
-d DELAY Delay between updates, in tenths of seconds
so running "htop -d 200" will only update every 20 seconds, giving you
time to select and copy the text like ...
4041 - root 20 0 7592 2160 1452 S 0.0 0.1 0:00.00 `- console-kit-daemon
4040 - root 20 0 7592 2160 1452 S 0.0 0.1 0:00.00 `- console-kit-daemon
4039 - root 20 0 7592 2160 1452 S 0.0 0.1 0:00.00 `- console-kit-daemon
4038 - root 20 0 7592 2160 1452 S 0.0 0.1 0:00.00 `- console-kit-daemon
4037 - root 20 0 7592 2160 1452 S 0.0 0.1 0:00.00 `- console-kit-daemon
4036 - root 20 0 7592 2160 1452 S 0.0 0.1 0:00.00 `- console-kit-daemon

> Is this standard behavior? A bug? My wag is that the process

"ps -A" doesn't show you everything. Try "ps -AL" or "ps -ALf". If you want to see
what a process is doing, from a console run "strace -p 4041" for the appropriate process
id, or in htop, use the cursor keys to highlight the process, and press the s key.
Very useful for debugging. In htop, you can also toggle showing the kernel threads with
the K key.

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)

Jim Beard

unread,
Mar 30, 2008, 8:37:20 PM3/30/08
to
David W. Hodgins wrote:
> "ps -A" doesn't show you everything. Try "ps -AL" or "ps -ALf". If you want to see
> what a process is doing, from a console run "strace -p 4041" for the appropriate process
> id, or in htop, use the cursor keys to highlight the process, and press the s key.
> Very useful for debugging. In htop, you can also toggle showing the kernel threads with
> the K key.

According to man ps:
To see every process on the system using standard syntax:
ps -e
ps -ef
ps -eF
ps -ely
<snip>

To get info about threads:
ps -eLf
ps axms

SIMPLE PROCESS SELECTION
-A Select all processes. Identical to -e.

The commands I ran were first ps -eF and second ps -ely.
From the above, it looks to me like this _should_ have
displayed all processes. But when I run ps -AL or
ps -ALf I do get the multiple repetitions of console-kit-deamon,
amarok, and other things mentioned in my original post.

Many thinks for the additional information on ps!

fuujuhi

unread,
Oct 5, 2008, 9:09:02 AM10/5/08
to

I experienced
the same on openSUSE 11. Many entries for console-kit-daemon, amarok,
...

It turns out that it is actually not different processes, but well all
threads that are run by a single process (ie. all using the same
memory context as the parent process).

If you don't want to see that information anymore, you can configure
htop to hide all userland thread:

Setup menu (F2) --> Display options --> Hide userland threads

And that's it!

0 new messages