I am trying to measure the RAM usage of MyProcess args
GNU time
Following this post
gtime -v ./MyProcess args
[..]
Maximum resident set size (kbytes): 303316992 # (303 GB)
[..]
I clearly don't have 303 GB of RAM on my computer!
zsh - time
Following this post
zsh
TIMEFMT='%J %U user %S system %P cpu %*E total'$'\n'\
'avg shared (code): %X KB'$'\n'\
'avg unshared (data/stack): %D KB'$'\n'\
'total (sum): %K KB'$'\n'\
'max memory: %M MB'$'\n'\
'page faults from disk: %F'$'\n'\
'other page faults: %R'
time ./MyProcess args
avg shared (code): 0 KB
avg unshared (data/stack): 0 KB
total (sum): 0 KB
max memory: 73204 MB # (73 GB)
page faults from disk: 0
other page faults: 18528
I don't have 73 GB of RAM on my machine either!
tstime
Following this post... I failed to install it!
Activity Monitor
The activity monitor gives me a RAM usage of about 60 MB. This is typically the RAM usage I was expecting.
Of course, MyProcess
is deterministic and RAM usage should not vary from one run to another.
Can you help me to figure out what is going wrong (if anything) and how I can measure RAM usage of a process with a time
like type of command?
FYI, I use Mac OS X 10.11.3