In the past, my method to measure peak memory usage was to boot a system, wait for it to become idle, run "free", run the program in question, then run "free" again. The difference is the memory usage. This method accounts for multi-process programs such as the LAMP stack, but it doesn't work as well for ephemeral command line utilities.
Today I ran across an easier way: Run the command line utility with /usr/bin/time -v. Example:
Code:
bash-4.2$ /usr/bin/time
...