Linux – htop – change units for memory usage display

htoplinuxmemory

How to display meminfo in megabytes in top? discusses how to change the units of memory (e.g. megabytes, gigabytes, etc.) when using top. Is there a way to do this in htop as well? man htop doesn't address this, neither does it seem evident from the info displayed via F1 when running the program.

Alternatively, if there were at least a way to change the threshold at which htop automatically switches from one unit to another, that would work. E.g. right now, it will display memory in terms of 4406M which I find quite difficult to read at a glance in a long line of processes. So, if I could just get it to not go above hundreds of units, and thus automatically switch this to, e.g. 4.4G, when it goes above 999M then that would work too.

Best Answer

I don't think it is possible, but, if you are up for building your own htop, not impossible. The code is at github and if you look at Meter.c you will see the logic they use to decide what to display.

Related Question