Bug 134704 - ktimemon incorrectly reports the slab usage
Summary: ktimemon incorrectly reports the slab usage
Status: RESOLVED FIXED
Alias: None
Product: ktimemon
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Dirk Mueller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-26 21:07 UTC by James Stark
Modified: 2006-09-28 20:20 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Stark 2006-09-26 21:07:08 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc 4.1.1 
OS:                Linux

ktimemon is currently reporting the memory used by the slab twice.  It is being reported as both kernel memory and user memory.  For a small slab size this isn't noticeable, however if the slab grows to being a significant portion of memory (running updatedb will cause this to happen) then the memory usage reported by ktimemon will become noticeably incorrect.

The following patch corrects the problem:

diff -Naur kdeaddons-3.5.4-orig/kicker-applets/ktimemon/sample.cc kdeaddons-3.5.4/kicker-applets/ktimemon/sample.cc
--- kdeaddons-3.5.4-orig/kicker-applets/ktimemon/sample.cc      2006-09-26 18:35:22.000000000 +0000
+++ kdeaddons-3.5.4/kicker-applets/ktimemon/sample.cc   2006-09-26 18:32:34.000000000 +0000
@@ -425,7 +425,7 @@

     sample.cputotal =
       sample.user + sample.nice + sample.kernel + sample.iowait + sample.idle;
-    sample.used = sample.mtotal - sample.free - sample.buffers - sample.cached;
+    sample.used = sample.mtotal - sample.mkernel - sample.free - sample.buffers - sample.cached;
     sample.sused = sample.stotal - sample.sfree;
 }
Comment 1 Dirk Mueller 2006-09-28 20:20:54 UTC
SVN commit 589831 by mueller:

fix kernel memory being counted twice. Thanks for the patch!
BUG:134704


 M  +2 -2      sample.cc  


--- branches/KDE/3.5/kdeaddons/kicker-applets/ktimemon/sample.cc #589830:589831
@@ -423,9 +423,9 @@
     sample.stotal = sample.sfree = 0;
 #endif
 
-    sample.cputotal = 
+    sample.cputotal =
       sample.user + sample.nice + sample.kernel + sample.iowait + sample.idle;
-    sample.used = sample.mtotal - sample.free - sample.buffers - sample.cached;
+    sample.used = sample.mtotal - sample.mkernel - sample.free - sample.buffers - sample.cached;
     sample.sused = sample.stotal - sample.sfree;
 }