Sorted tree view in htop or alternative?

15

3

I am running a Debian flavor of Linux, and I use htop to keep track of memory usage, since it is more detailed than top. I can't seem to get it to sort by memory and display process trees at the same time. Is there a way to do this with htop or an alternative?

bright-star

Posted 2014-05-02T04:55:32.900

Reputation: 1 489

Answers

7

Looks like Glances should have what you need:

glances --tree

And then sort using commands m,t, i etc. Full command reference

pkk

Posted 2014-05-02T04:55:32.900

Reputation: 119

3

This option was removed last year: https://github.com/nicolargo/glances/commit/631722992e76827ecee61797edd3ab218e28c94a

– pkk – 2019-06-07T09:14:11.140

0

A 2019 update on this 2014 question that ranked highly when searching for this topic is that htop has this built in now, and in the current version 2.2.0, simply pressing t in the default view generates a process hierarchy.

Rich L

Posted 2014-05-02T04:55:32.900

Reputation: 101

0

Not with htop (and probably with any other alternative) as both views are mutually exclusive: either you list processes sorted by memory, or respect the PPID/PID tree view. You can have both at the same time.

dawud

Posted 2014-05-02T04:55:32.900

Reputation: 1 305

1On one of my server htop 1.0.1 does indeed lists the processes and their threads in tree view and sorted by CPU% (based on the process cpu%). On my other server, there is htop 1.0.2 and setting sort by CPU% automatically clears the tree view. – karatedog – 2016-06-21T17:20:43.780

2To clarify what @TrevorAlexander said, siblings in the tree could be sorted against one another without breaking the tree display – Aaron J Lang – 2016-09-02T10:12:55.387

12Sure, but since there is a hierarchical relationship there, you could aggregate the memory or CPU usage of the tree and then sort on that. – bright-star – 2014-05-03T03:08:10.020