openSUSE 12.1: htop (and System Monitor) show wrong information about used and cached memory

Hello to everyone!

Right after I install openSUSE 12.1 KDE (fully btrfs), I found very strange behavior:
htop as well as System Monitor (Gnome or KDE) show wrong information about free and cached information.

And for some reason right after some work with zypper amount of used memory drastically increases.
For example, I decide to install ‘ibus’. Before installation in ‘htop’ used memory was 1350Mb (in ‘free’ it was only 800Mb).
During install ‘htop’ shows 1400–1450Mb (‘free’ shows about 850Mb).
Right after installation is complete, used memory start its increase ~100Mb/s and stops at 2050Mb. (‘free’ get back to 800Mb and don’t change).
In detail:: htop (2050 in use, 150 free, 1750 cached, 50 buffered), free (800 in use, 150 free, 3000 cached, 50 in buffer)

After I found another strange behavior. I installed prelink and start it as ‘prelink -afmvR’.
During that process according to ‘htop’ used memory decreases by 700Mb (100 goes to free memory, 600 to cached).
So after prelink is finishes:: htop (1350 in use, 250 free, 2350 cached, 50 in buffer), free (800 in use, 250 free, 2900 cached, 50 in buffer).

If I sum up all the RES values in ‘htop’, then it be ~1100Mb (not 2050Mb, nor 1350Mb),
if I sum up difference between RES and SHR, it would be ~700Mb

Right now I have openSUSE 12.1 installed on ext4 with LVM.
All recent updates are installed.

Difference between measurements of a free memory according to ‘System Monitor’ (as well as ‘htop’) and ‘free’ about 500Mb.
I know what ‘free’ gives correct value, but I don’t know why others are wrong.

Has anyone such a problem??

So since free seems to work OK, then what problem are you trying to solve? Why not give us the output from free in terminal to compare it with ours? Is your present causing any problems?

Thank You,

On 2012-05-11 10:26, sh1go wrote:

> Has anyone such a problem??

Used memory in free, minus (cached + buffers) in free is equal to used
memory in htop.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

http://thumbnails47.imagebam.com/19002/ec58d5190016459.jpg](http://www.imagebam.com/image/ec58d5190016459)
http://thumbnails69.imagebam.com/19002/84872a190016463.jpg](http://www.imagebam.com/image/84872a190016463)
Here two pictures.

What is not Ok – is confusing information in htop and System Monitor.
I use htop often to control processes, whats why I want it to show correct information

On 2012-05-13 14:06, sh1go wrote:

> What is not Ok – is confusing information in htop and System Monitor.
> I use htop often to control processes, whats why I want it to show
> correct information

The information is correct in both - do the math.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

you mean that 1177==1004, and 2469==2616 ?
Sorry, but from my calculation these numbers are not the same.

and please, read the first message again.

This problem happens to be only in openSUSE. I used Ubuntu, Debian, Fedora, Slackware, Arch Linux, Gentoo and their ‘memory counters’ from ‘htop’ and ‘free’ match.

It seems to me that the two examples for you are practically identical and that htop provides more detail and that memory usage is dynamic, updating each time it is run. I still would ask, what problem does it create and if there is a problem that you can state, why not post a detailed bug report for the alleged problem?

https://bugzilla.novell.com/index.cgi

Thank You,

On 2012-05-13 17:56, sh1go wrote:
>
> you mean that 1177==1004, and 2469==2616 ?
> Sorry, but from my calculation these numbers are not the same.

3735 - 2616 = 1116 which is roughly the same as 1117. They match.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

  1. I didn’t understand what do you mean by ‘practically identical’. If this is about difference of only about 150Mb, then NOT. The difference varies from 100Mb to 500Mb, sometimes more.
  2. ‘htop’ really provides more detail information and in realtime, while free gives only static info at one point of time.
  3. problem is “misunderstanding of really used memory”. From now on I know that in terms of overall used memory i could believe only ‘free’. But usually I monitoring processes using more useful ‘htop’.
  4. Ok, then I’ll make a bug report.

oh, this is really smart and funny. I would really appreciate If you read what is this topic about.

On 2012-05-13 19:06, sh1go wrote:

> robin_listas;2462411 Wrote:
>>
>> 3735 - 2616 = 1116 which is roughly the same as 1117. They match.
>>
> oh, this is really smart and funny. I would really appreciate If you
> read what is this topic about.

So do I.

Do what you please, you are not reading. Bye.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Sorry for my words. It seems there were bad times.

One year later maybe we should continue our discussion. openSUSE 12.3 have same bahaviour =)
Let’s do the math according to the pictures on the first page.
HTOP says: 3894 total, 2469 cached, 114 buffered.
3894-2469-114 = 1311
and this is even larger than value 1177 of used memory mentioned in ‘htop’.
FREE says 3894 total, 2616 cached, 114 buffered, 159 free.
3894-159-114-2616 = 1005
this is exactly what it says about used memory.

What can I conclude out of that: htop seems to have wrong algorithm of calculation of cached memory, or there are promlems with ‘free’ memory.

On 05/15/2013 05:46 PM, sh1go wrote:
> What can I conclude out of that: htop seems to have wrong algorithm of
> calculation of cached memory, or there are promlems with ‘free’ memory.

please tell us the number of the bug you lodged against htop and/or
free last year…i want to check its status today.


dd