After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 112194 - multiload adds cached mem to user mem instead of buffer mem
multiload adds cached mem to user mem instead of buffer mem
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: multiload
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-05-04 09:23 UTC by Markus Bertheau
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.30 KB, patch)
2003-05-04 09:23 UTC, Markus Bertheau
none Details | Review

Description Markus Bertheau 2003-05-04 09:23:25 UTC
The multiload applet calculates the memory like this:

    user = mem.used - mem.buffer - mem.shared;
        
    user    = rint (Maximum * (float)user   / mem.total);
    shared  = rint (Maximum * (float)mem.shared / mem.total);
    buffer  = rint (Maximum * (float)mem.buffer / mem.total);
    free    = rint (Maximum * (float)mem.free / mem.total);

mem.cached, which is a very significant portion of my memory here, that was
lands in user, which always leads to the false assumption, my memory was
80% - 90% used, where it's really 40% (the -/+ buffers/cache line in free
output). I suggest the following computation:

    user = mem.used - mem.buffer - mem.shared - mem.cached;
        
    user    = rint (Maximum * (float)user   / mem.total);
    shared  = rint (Maximum * (float)mem.shared / mem.total);
    buffer  = rint (Maximum * (float)(mem.buffer + mem.cached) / mem.total);
    free    = rint (Maximum * (float)mem.free / mem.total);

Attached is a patch.
Comment 1 Markus Bertheau 2003-05-04 09:23:52 UTC
Created attachment 16245 [details] [review]
patch
Comment 2 Markus Bertheau 2003-05-04 09:49:35 UTC
Hmm, man free says
[...]The shared memory column should be ignored; it is obsolete.[...]

Does that also apply to libgtop?
Comment 3 Kevin Vandersloot 2003-05-04 14:23:03 UTC
Woops this has been fixed in cvs (with a seperate cached graph now).
Comment 4 Markus Bertheau 2003-05-04 14:38:15 UTC
Shouldn't shared be removed, given the comment in the free manual page?
Comment 5 Kevin Vandersloot 2003-05-04 19:20:53 UTC
Yah, if so then please open another bug.