ps -axo user,%cpu,%mem - most processes using 0% of memory

From: Alex Keda <admin_at_lissyara.su>
Date: Tue, 19 Jan 2010 09:30:01 +0300
Hi!
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.

I attach patch to correct this

srv2# diff -Nru bin/ps/print.c ~lissyara/print.c
--- bin/ps/print.c      2009-09-07 13:51:23.000000000 +0400
+++ /usr/home/lissyara/print.c  2010-01-19 09:17:25.000000000 +0300
_at__at_ -629,7 +629,7 _at__at_
        VAR *v;

        v = ve->var;
-       (void)printf("%*.1f", v->width, getpcpu(k));
+       (void)printf("%*.2f", v->width, getpcpu(k));
 }

 static double
_at__at_ -657,7 +657,7 _at__at_
        VAR *v;

        v = ve->var;
-       (void)printf("%*.1f", v->width, getpmem(k));
+       (void)printf("%*.2f", v->width, getpmem(k));
 }

 void
srv2#  
Received on Tue Jan 19 2010 - 05:30:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:00 UTC