[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Getting the memory used by a process



Excerpts from Mathieu Malaterre's message of Wed Dec 08 11:59:32 +0100 2010:

[memory usage of short-lived process]
>   Any other tool, other than pmap to do find that information ? I
> would also like to avoid something as heady as valgrind --tool=massif.

If it's only a single process you're interested in (i.e. it doesn't
spawn child processes) then /usr/bin/time (_not_ the "time" built-in
of bash) might be a useful approximation:

sascha.silbe@twin:~$ /usr/bin/time ls > /dev/null
0.00user 0.00system 0:00.01elapsed 50%CPU (0avgtext+0avgdata 4064maxresident)k
0inputs+0outputs (0major+312minor)pagefaults 0swaps

Another approach is BSD accounting. See the 'acct' package; IIRC I used
the "sa" tool.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/

Attachment: signature.asc
Description: PGP signature


Reply to: