When I run free -m on my command-line, it shows my used memory as show below. When I run htop the used memory shown is very low.

Why is that? Is it some other kind of representation? I am new to Linux. So I am totally blank on these stuff.

   total   3    used       free     shared    buffers     cached
   5863       4980        882          0        903       3025



The used memory in free shows 4980MB and in htop shows 1076MB. What do they actually represent?


Main difference is htop counts cached memory and buffers into free memory, whereas free command does not. That would give using free command

4980 - 3025 - 903 = 1052 used memory

that gives pretty close results with 1076 from htop. Difference can be explained here. (That explains it on openSUSE I think on Ubuntu it will be nearly same), or if you are not running both commands at the same time.

Here is explanation why buffers and cached memory is sometimes considered free.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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