command memory footprint

Hello people,
How can I record the memory footprint of a command?

Something like: [file]memorynator[/file] grep '.*thing' big_file

Thanks..
 
time(1)?
Code:
$ command time -l fgrep 'some thing' big_file_11G
      150.72 real         6.56 user         4.67 sys
      1612  maximum resident set size
       111  average shared memory size
      3953  average unshared data size
       127  average unshared stack size
       194  page reclaims
         0  page faults
         0  swaps
     80875  block input operations
         1  block output operations
         0  messages sent
         0  messages received
         0  signals received
      2378  voluntary context switches
      4917  involuntary context switches
command part is important as many shells including sh(1) and tcsh(1) implement time builtin which may or may not be compatible with /usr/bin/time.
 
Back
Top