How do I check the maximum amount a RAM a process uses similar to how time works?

$ time mvn package
real    0m35.796s
user    0m32.925s
sys     0m1.559s

$ maxmem mvn package
688 MB

Try using GNU time instead of the built-in.

On CentOS, you would install it with yum install time then run it with /usr/bin/time <command>

Note that you need to specify the full path; otherwise the shell will want to use the built-in time

| improve this answer | |
  • Oh wow I didn't know that was a built-in and /usr/bin/time already gives memory usage. – Chloe Feb 4 '19 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.