Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
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

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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