ClementTsang / bottom

Yet another cross-platform graphical process/system monitor.
https://clementtsang.github.io/bottom
MIT License
9.91k stars 234 forks source link

For tree mode, add an option to sort the top-level parent processes according to the summation of resource usage of child processes. #684

Open whatbh opened 2 years ago

whatbh commented 2 years ago

In the current behavior of tree mode, when sorting process by resource usage (CPU, mem), the sorting is according to the values of top-level processes. This leads to situation when parent process using little resource can spawn heavy child processes, and these processes are buried at the bottom of the process viewer. One idea to make this more convenient is to summarize the resource usage of all child processes, and sort the top-level parent processes according to these values. This behavior can be make into separate command line flag to avoid tampering with existing behavior. Using summation scheme, either a parent process contains a few child processes that's very heavy, or contain many processes that is heavy when summed up, it is sorted to the top.

daiaji commented 2 years ago

Even though I'm using a 1440p monitor, my screen isn't long enough to show all the subprocesses, obviously your work is necessary. In tree mode, all non-PID1 processes are collapsed by default, which is also very helpful for usability.

musjj commented 1 year ago

This is something I've been looking for too. In addition to sorting, it would also be nice to actually see the total memory usage of a tree displayed somewhere. Maybe we can just have another column for this?

EDIT: Never mind, this is already possible by going to tree mode (T), and then collapsing the tree (-/+)