Re: [flalug] more memory questions...

From: Eben King (eben1@tampabay.rr.com)
Date: Wed Mar 10 2004 - 13:15:02 EST


On Wed, 10 Mar 2004, Larry Brown wrote:

> Does anyone know how to get the exact amount of memory used for a process?
> In ps it renders a percentage number.

Is "top -b -n 1 | grep '^ *$pid ' | awk '{ print $5 }'" what you want?
That's RSS. I suppose you could take top's percentage and multiply it by
the total amount of memory, but the percentage is at most three
significant digits, usually fewer.

Also, /proc/<pid>/status is interesting. For an xterm, I get:

...
VmSize: 2448 kB
VmLck: 0 kB
VmRSS: 1436 kB
VmData: 348 kB
VmStk: 24 kB
VmExe: 588 kB
VmLib: 1420 kB
...

So I guess it kinda depends what you mean by "memory".

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
              
           This message was created using recycled electrons.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:14:53 EDT