3

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.

  • 1
    It is correct, it is just that you are not interpreting the colors correctly, as Sukminder tried to point out. The reason that you have all those bars is because the number of bars represents the total of "used" (green) + "buffers" (blue) + "cache" (orange) whereas the metric at the end is just "used"/total. The "used" category may be confusing in relation to buffers and cache if you don't understand the difference between these things and why they are considered important -- in which case, just ask. – goldilocks Mar 8 '13 at 22:54
  • I was under the mistaken impression that all the "used" memory was the bars, and that it just changed color as it got higher, like a VU meter on a stereo. : \ My mistake! – wulftone Mar 8 '13 at 22:58
5

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.

  • 1
    Actually, using the monochromatic color scheme makes it a bit nicer, since the Used memory (|) is very obviously different from the Buffers (#) and Cached (*). I think I'll just go with that and call it good. Thanks for the explanation! – wulftone Mar 8 '13 at 22:56
  • Sorry but I could still not understand this, googled around and I do not understand. The only assumption I'm making is that the bar is always full, and just shows what part of used memory is being used/cache/buffers, to the proportion of USED memory (so the entire bar is to the scale of total USED memory?) Could either of you confirm @wulftone ? Thanks! – GigaBass Jun 8 '18 at 15:19
  • The bar isn't always full @GigaBass, check it out right when you start up your machine and you should (hopefully) see it only partway used. – wulftone Jun 9 '18 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.