Change the scale of the bar graph in htop

htop

Does anyone know of a way to change the scale of the bar graphs in htop? The memory one, specifically, doesn't seem based off of percent of memory used–it's some other scale that seems useless to me.

It looks like this:

Mem[|||||||||||||||||||||||||||||||||||||||||||| 1978/7847MB]

When it should look like this:

Mem[||||||||||                                   1978/7847MB]

…to reflect the correct ratio of memory usage.

I am under the impression htop is highly customizable, but I'm not sure how to do this.

Best Answer

Don't you have colors?

    Green        Blue             Orange
Mem[|||||||||||||||||||||||||||||||||||||||||||| 1978/7847MB]

Where green should be 1978 MiB.

Else you can enter F2 -> Under setup stay on "Meters" -> Right arrow to get to "Left column". -> Down 1 to get to "Memory Bar".

Then press enter to view various ways of display.


When it comes to what the bar displays it is like this.

It reads /proc/meminfo and show - colors depend on "Colors" setting - this is default:

Used U (green): (MemTotal - MemFree) - (Buffers + Cached) / 1024

And then the percentage of MemTotal of that.

Bar:

 Green               Blue                 Orange/Yellow
[Used U % of total | Buffers % of total | Cached % of total ] Used U / Toatal MB

Also see here.


I have a script some where that makes it as well. Have to look for it.