Bug 316171 - Ksysguard report wrong memory consumption
Summary: Ksysguard report wrong memory consumption
Status: RESOLVED INTENTIONAL
Alias: None
Product: ksysguard
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-05 13:47 UTC by Lê Hoàng Phương
Modified: 2019-03-11 18:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of top and ksysguard (164.12 KB, image/png)
2013-03-05 13:48 UTC, Lê Hoàng Phương
Details
Different Memory Sensors available in ksysguard (107.33 KB, image/png)
2019-03-11 18:06 UTC, Richard Llom
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lê Hoàng Phương 2013-03-05 13:47:10 UTC
Using top, the memory consumption is 1.8 / 3.7 GB while ksysguard only report 1.2 GB memory used


Reproducible: Always

Steps to Reproduce:
1. Open ksysguard
2. Execute top command
3. Compare the memory consumption between these two application
Actual Results:  
ksysguard reports smaller memory consumption (which is wrong)

Expected Results:  
2 reporters should have the same result
Comment 1 Lê Hoàng Phương 2013-03-05 13:48:57 UTC
Created attachment 77773 [details]
Screenshot of top and ksysguard
Comment 2 John Tapsell 2013-03-05 15:00:09 UTC
Hi,

  Top considers caches and buffers to be used memory.  I (and thus ksysguard) consider them to be free memory.  (Note that the difference is the sum of the buffers and cached shown in top).

  In an ideal situation, every single kb of memory in the computer will be "used" for caching.  So it's not very useful to count them as "used" imho.
Comment 3 Lê Hoàng Phương 2013-03-05 15:11:39 UTC
But it is a real problem when we use applications like VMWare. VMWare takes a lot of memory (nearly full in my case) and ksysguard still sees the machine having 50% memory free.
Comment 4 John Tapsell 2013-03-05 17:42:28 UTC
(In reply to comment #3)
> But it is a real problem when we use applications like VMWare. VMWare takes
> a lot of memory (nearly full in my case) and ksysguard still sees the
> machine having 50% memory free.

But again, theoretically, vmware probably should be using 100% of memory.  Memory not used it wasted.  Cached memory can be instantly reclaimed by the system when needed.  When judging the memory usage of vmware, all you should care about is the non-cached memory.
Comment 5 John Tapsell 2013-03-05 17:45:54 UTC
I should probably clarify that when it comes to memory usage, there's not really a right or wrong answer on how to measure it.

What I'm interested in is what you are trying to do, why you think it should include caches, etc.  What sort of information you're after.

For example, I wouldn't mind having some option to include or exclude the cache/buffers.  If such a thing would be actually useful.
Comment 6 Lê Hoàng Phương 2013-03-06 01:50:24 UTC
I do not really know much about the technical detail. But from a user perspective, I can see when my system hangs/lags, the cause mostly is it's running out of memory. 

In my case, when using vmware, sometimes the system hangs for some seconds, which indicates that the memory is all used (but not buffered or cached). Though ksysguard only says that memory consumption is only 50% (through its plasmoid), while top accurately says all the memory is used. Do you think that information is helpful in my case? And I also don't think that information is true either because the memory is indeed used (not buffered or cached).

As I said, I do not know much about the underlying memory usage monitoring system. These opinions are only what I'm feeling. I hope to have some more knowledge from you.
Comment 7 John Tapsell 2013-03-06 08:14:37 UTC
> I can see when my system hangs/lags, the cause mostly is it's running out of memory.

Which is why I don't want to show the caches.

Theoretically (and I must emphasize that part) your system should not hang or lag if your memory is used up by cache.

When a new application asks for the memory, the cache should be instantly reclaimed and given to the new application.  Resulting in no delay or lag for you.


> In my case, when using vmware, sometimes the system hangs for some seconds,
which indicates that the memory is all used (but not buffered or cached).

I honestly don't know.   It's not supposed to hang or lag if you have plenty of cached memory.  It's supposed to be instantly reclaimed.
Comment 8 John Tapsell 2013-03-06 08:40:26 UTC
You might be interested in reading:  http://stackoverflow.com/questions/599719/how-to-clean-caches-used-by-the-linux-kernel
Comment 9 Richard Llom 2019-03-11 18:06:35 UTC
Created attachment 118721 [details]
Different Memory Sensors available in ksysguard
Comment 10 Richard Llom 2019-03-11 18:11:50 UTC
Maybe a bit late to the party, but:

There are different kinds of memory sensors available in ksysguard (see just attached screenshot).
By default ksysguard displays the application memory. If you need a different metric, you have to create your own graph in a new tab.

In the future it might be possible to alter the sensors in the System Load tab, this is tracked in bug 404637.

Closing as RESOLVED INTENTIONAL.