How to read htop graph

I don't understand how to read the htop graph. What's the difference between the green, blue, yellow, and red (not shown) bars?
LVL 32
Who is Participating?
getBmanConnect With a Mentor Commented:

The colors mean different things depending on the usage bar you are reading.

CPU usage bar:
Blue = low-priority
Green = normal
Red = kernel

Memory bar:
Green = used
Blue = buffers
Yellow = cache

Swap bar:      
Red = used

After executing htop - you can hit your F1 Key to get additional help for colors and keyboard shortcuts.

DrDamnitAuthor Commented:
So the bar is subdivided out into various categories of usage. But the overall amount is the actual, in use amount, right?

On my system for example "top" shows me I have about 4G total Memory, 3.2G Used which would be right around 83% total used.

When I run Htop the memory graph shows me 3 Green Bars, 2 Blue and the rest Yellow.

The combined total of the bars is approximately 83%.

So the combined bars regardless of colors should indicate the total memory used.

The beginning "[" would then be 0% and ending "]" would indicate 100%

Hope this helps,
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Monis MontherConnect With a Mentor System ArchitectCommented:
No exactly

The yellow which consumes most of the bar is Cached, this is a feature in the Linux kernel

Under Linux any unused memory is wasted resource, so it tries to make use of it and put this memory in a buffer for faster access when needed, so you can consider it unused because when you open a app it will take out from this buffer cache first.

You can flush it from a setting in /proc , but I dont really remember the parameter for it now and you dont need to do that , its better functioning this way.

Same goes for the blue (buffers or kernel bufferes0

So the Green is what is actually used and is the number that you find at the end of the bar

Hope this helps
Thank you small_student
Monis MontherSystem ArchitectCommented:
You can also double check the exact amount of used memory by running the free command

one my servers shows the following

                     total       used       free     shared    buffers     cached
Mem:        515492     372332     143160          0      60312     248732
-/+ buffers/cache:      63288     452204
Swap:      2096472         72    2096400

So as you can see in the second line the used memory is 63288 which is 63MB this is the number that I get in the htop bar at the end which is what exactly is used

In your case your bar shows 323, this is what is used
All Courses

From novice to tech pro — start learning today.