The Computer Oracle

Sorted tree view in htop or alternative?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Track title: CC C Schuberts Piano Sonata No 13 D

--

Chapters
00:00 Sorted Tree View In Htop Or Alternative?
00:27 Answer 1 Score 11
00:51 Accepted Answer Score 8
01:11 Answer 3 Score 1
01:34 Answer 4 Score 1
01:55 Thank you

--

Full question
https://superuser.com/questions/748750/s...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #memory #memorymanagement #top #htop

#avk47



ANSWER 1

Score 11


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.




ACCEPTED ANSWER

Score 8


Looks like Glances should have what you need:

glances --tree

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




ANSWER 3

Score 1


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.




ANSWER 4

Score 1


In htop version 3 (I believe, 3.0.3 to be exact) you can sort by other columns than pid even in tree mode.

See the changelog.

It's not perfect, because it doesn't aggregate memory from sub processes, but it's a nice feature nonetheless.