[PATCH] multiload: add mem.cached to mem.buffers instead of mem.user



Hi,

in my opinion the multiload applet calculates the fractions of the
memory wrongly, the attached patch fixes that, See also
http://bugzilla.gnome.org/show_bug.cgi?id=112194 .

-- 
Markus Bertheau.
Berlin, Berlin.
Germany.

diff -ur gnome-applets-2.2.1.orig/multiload/ChangeLog gnome-applets-2.2.1/multiload/ChangeLog
--- gnome-applets-2.2.1.orig/multiload/ChangeLog	2003-03-10 18:46:03.000000000 +0100
+++ gnome-applets-2.2.1/multiload/ChangeLog	2003-05-04 11:20:05.000000000 +0200
@@ -1,3 +1,8 @@
+2003-05-04  Markus Bertheau <twanger bluetwanger de>
+
+	* linux.proc.c: Add mem.cached to mem.buffers instead of
+	mem.user
+
 2002-12-16  Kevin Vandersloot <kfv101 psu edu>
 
 	* Makefile.am: don't dist the .server.in file since
diff -ur gnome-applets-2.2.1.orig/multiload/linux-proc.c gnome-applets-2.2.1/multiload/linux-proc.c
--- gnome-applets-2.2.1.orig/multiload/linux-proc.c	2003-03-10 18:46:03.000000000 +0100
+++ gnome-applets-2.2.1/multiload/linux-proc.c	2003-05-04 10:48:43.000000000 +0200
@@ -137,11 +137,11 @@
 	
     assert ((mem.flags & needed_mem_flags) == needed_mem_flags);
 
-    user = mem.used - mem.buffer - mem.shared;
+    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.total);
+    buffer  = rint (Maximum * (float)(mem.buffer + mem.cached) / mem.total);
     free    = rint (Maximum * (float)mem.free / mem.total);
 
     data [0] = user;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]