Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Mar 2001 01:42:48 +0900
From:      Yoshihiro Koya <Yoshihiro.Koya@math.yokohama-cu.ac.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/25545: Incorrect output of top(1)
Message-ID:  <20010306014248K.ipfw@ya3.so-net.ne.jp>

next in thread | raw e-mail | index | archive | help

>Number:         25545
>Category:       bin
>Synopsis:       Incorrect Mem value produced by top(1).
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 05 08:40:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Yoshihiro Koya
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Dpet. of Math. Sci, Yokohama City University
>Environment:
System: FreeBSD current.my.domain 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Mon Mar 5 20:08:25 JST 2001 root@current.my.domain:/usr/obj/usr/src/sys/current i386
>Description:
The value produced by top(1) is incorrect.
For example,

last pid:   734;  load averages:  0.13,  0.04,  0.02      up 0+00:26:37  01:32:02
33 processes:  1 running, 32 sleeping
CPU states:     % user,     % nice,     % system,     % interrupt,     % idle
Mem: 9044K Active, 8241K Inact, 5703K Wired, 15K Cache, 35M Buf, 40M Free
Swap: 256M Total, 256M Free

The output above was obtained on the machine with 256MB ram.
The sum of value "Active", "Inact", "Wired", "Chache", "Buf" and "Free"
seems to be too small.
>How-To-Repeat:
% top

and investigate its output.
>Fix:

--- machine.c.orig	Tue Mar  6 01:23:21 2001
+++ machine.c	Tue Mar  6 01:31:37 2001
@@ -330,7 +330,12 @@
 	GETSYSCTL("vm.stats.vm.v_swappgsin", nspgsin);
 	GETSYSCTL("vm.stats.vm.v_swappgsout", nspgsout);
 	/* convert memory stats to Kbytes */
+	memory_stats[0] = pagetok(memory_stats[0]);
+	memory_stats[1] = pagetok(memory_stats[1]);
+	memory_stats[2] = pagetok(memory_stats[2]);
+	memory_stats[3] = pagetok(memory_stats[3]);
 	memory_stats[4] = bufspace / 1024;
+	memory_stats[5] = pagetok(memory_stats[5]);
 	memory_stats[6] = -1;
 
 	/* first interval */
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010306014248K.ipfw>