Tom Smith Tom Smith - 2 years ago 55
Bash Question

Is there a way to measure how much a shell command used memory?

Is there a way to measure how much an executed terminal command/operation used memory, like the built-in command

for measuring execution time. I'd like to compare commands with different parameters.

Answer Source

I was looking for something like this:

This is how I used it:

$/usr/bin/time -f "%E %M" *<command>*

That gave me:
%E - elapsed real time (in [hours:]minutes:seconds);
%M - maximum resident set size of the process during its lifetime, in kB.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download