Re: [vox-tech] command to monitor memory usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox-tech] command to monitor memory usage
On Sun, 2009-08-23 at 01:45 -0400, Peter Jay Salzman wrote:
> On Sat 22 Aug 09, 10:37 PM, Bill Kendrick <nbs@sonic.net> said:
> > On Sat, Aug 22, 2009 at 09:37:49PM -0500, Ken Bloom wrote:
> > > Top is good if you get the filtering and sorting options right so that
> > > the process you're interested in stays on the list (and doesn't get
> > > crowded out of the list by more resource-hungry programs).
> > <snip>
> >
> > Not that I've ever really done it, but it's probably also reasonable
> > to go into /proc/{PROCESS_ID}/ and do a 'cat status' and/or some other
> > 'file(s).' No?
> >
> > -bill!
>
> Prolly not. Which fields relate to memory usage? I took a look; can't
> figure it out. Proc files aren't terribly concerned with human readability;
> they are more meant for tools.
>
> Why not just use ps? It's there, it works, it's reasonably friendly, it has
> a man page. :)
The fields in /proc/$pid/status that start with Vm (e.g. VmExe, VmStk,
VmRss) the sizes of various different pieces of memory. /proc/$pid/maps
tells you the addresses taken up by mmapped files (such as libraries) as
well as the size of the stack and the heap. Some quick hexidecimal
subtraction can tell you how big these spaces are.
AFAIK, because Linux has lots of great ways of sharing physical memory
pages between processes, and only loading the parts of libraries that it
needs, nothing can tell you how much physical memory space is occupied
by a given program.
--Ken
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech
|