Bug 155309 - sysinfo kioslave free memory report should be changed
Summary: sysinfo kioslave free memory report should be changed
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: KDE (show other bugs)
Version: Beta 6
Hardware: All SuSE Linux 10.1
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-05 01:15 UTC by Forgotten User 55iwwMllzz
Modified: 2006-03-06 10:27 UTC (History)
2 users (show)

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Forgotten User 55iwwMllzz 2006-03-05 01:15:10 UTC
The free memory reported by the sysinfo kioslave (since Beta 6 it gained great visibility because it has become "My Computer" homepage) has the potential to stir up the old frequently asked questions from newbies: «why does my Linux reports so little free memory?», «why is Linux eating all my RAM when I don't have any application open?», etc.

In order to avoid endless amounts of emails sent to Support and to forums, 
this confusion could be prevented if the free memory reported by sysinfo:/ does not to include memory used by cache and buffers (as reported by /proc/meminfo).
Comment 1 Stephan Kulow 2006-03-05 13:55:34 UTC
hmm, then we get bug reports that say our information about free memory is wrong ;(

Here is my workstation's memory:
Mem:    513840k total,   415460k used,    98380k free,    66220k buffers
Swap:  1020088k total,   123964k used,   896124k free,   144064k cached

So you could add free+buffers+cached and declare that as "free", but as a matter of fact, that's not exactly free as if you invalidate caches your system won't be the same as before. 

But then again, 22mb free memory on my laptop are just very wrong:
Mem:   1035408k total,  1017820k used,    17588k free,    61504k buffers
Swap:  1967920k total,       24k used,  1967896k free,   741224k cached

Both use a very similiar amount of memory - so in some sense the laptop has more memory free. I'm undecided - especially as we're way behind message freeze, so my only two options are leaving out this value at all or redefining "free memory" as +cached+buffers.

Any other opinions?
Comment 2 Lubos Lunak 2006-03-05 18:03:11 UTC
I don't think you can really win here given that most of the values don't make sense for Joe User. Total is ok, used includes buffers/caches so it's confusing for Joe User, similar for free, buffers is uninteresting and cached is actually wrong.

Maybe the best solution would be to say "Free : X ( Y )", where X is free+buffers+cached and Y is just free. That way everybody should be happy they see their favourite nonsensical number there ;) .
Comment 3 Stephan Kulow 2006-03-05 19:33:20 UTC
I might play with a graphical representation - your X (Y) looks confusing, especially as this HTML page has no mentioning in the documentation.
Comment 4 Dirk Mueller 2006-03-06 00:15:18 UTC
the result would still be wrong. at least add slab caches as well. 
Comment 5 Michael Matz 2006-03-06 06:55:48 UTC
I would experiment with a horrible hack: Make the amount of "free" memory
presented to the user be free+buffers+cache-{20-50}MB .

I would not add slab memory, as that one is not easily freed (only by
actually using less objects, like files, sockets, processes and so on), unlike
buffers/cache which can just be discarded (and is).

The rationale for the 20-50 MB offset is that the system tend to use that
amount as minimum buffers/cache, as soon as it stopped swapping in again in
a nearly-oom situation.  What I mean here: Create a mem-eater program, use
it to reduce all buffers/cache to a minimum.  That will also swap out stuff,
or discard mapped read-only pages.  When it's done, wait a bit and touch
all user programs (by clicking each program window once, which is what Joe
user would do if asked to somehow "activate" all programs once).  Then look
at the amount of buffers/cache.  It won't be very high, but that's the amount
which in effect is "used by the system".  Depending on an uncountable number
of circumstances this amount will vary, but 20 to 50 MB is IMHO a good
approximation of it.

Yes, that's an illogical algorithm, but IMHO it would give sensible
numbers without showing unrealistically high free-mem values.
Comment 6 Stephan Kulow 2006-03-06 10:27:37 UTC
thanks everyone for the input. I added a sum of all three ;)

1. on my laptop the slabs cache counted up to 350MB before I discarded it with a fork bomb, so I counted that in as discardable.
2. I remove 50MB of the caches for the system to have without calling it free
3. the display looks now on my laptop (see #1) Free: 17.5MB (+890MB) 

We might need to change it to display Used memory in the future ;)