Date: Thu, 25 Feb 2010 14:40:16 GMT From: Alex Keda <admin@lissyara.su> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/144285: ps -axo user, %cpu, %mem - most processes using 0% of memory Message-ID: <201002251440.o1PEeG2s070931@www.freebsd.org> Resent-Message-ID: <201002251450.o1PEo1wI046192@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 144285
>Category: misc
>Synopsis: ps -axo user,%cpu,%mem - most processes using 0% of memory
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Feb 25 14:50:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Alex Keda
>Release: 7.2-STABLE
>Organization:
USSR
>Environment:
FreeBSD srv2.host-food.ru 7.2-STABLE FreeBSD 7.2-STABLE #0: Sun Oct 4 01:38:34 MSD 2009 lissyara@srv.host-food.ru:/home/obj/usr/src/sys/HOST-FOOD i386
>Description:
Modern computers have a large amount of memory.
But, in ps(1) source I see:
(void)printf("%*.1f", v->width, getpcpu(k));
(void)printf("%*.1f", v->width, getpmem(k));
0.1% - it very big.
for 8Gb ram it = 8mb
Many of the processes is less than this number.
>How-To-Repeat:
ps -axo user,%cpu,%mem
>Fix:
see patch
Patch attached with submission follows:
--- /usr/src/bin/ps/print.c.orig 2010-01-22 23:09:53.000000000 +0300
+++ /usr/src/bin/ps/print.c 2010-01-22 23:10:06.000000000 +0300
@@ -645,7 +645,7 @@
VAR *v;
v = ve->var;
- (void)printf("%*.1f", v->width, getpcpu(k));
+ (void)printf("%*.2f", v->width, getpcpu(k));
}
static double
@@ -673,7 +673,7 @@
VAR *v;
v = ve->var;
- (void)printf("%*.1f", v->width, getpmem(k));
+ (void)printf("%*.2f", v->width, getpmem(k));
}
void
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002251440.o1PEeG2s070931>
