Equivalent time to check memory

we can use timein unix environment to find out how much time has passed ...

shell> time some_random_command
real    0m0.709s
user    0m0.008s
sys     0m0.012s

Is there an equivalent for using the memory of the process (s) memory?

in particular, I am interested in the distribution of peaks.

+5
source share
2 answers

Check the man page for a while. You can specify a format string where you can display memory information. For example:

> time -f "mem:% M" some_random_command
mem: NNNN

displays the maximum resident set size for a process during its lifetime, in Kilobytes.

+4
source

Can't you use ps? for example ps v <pid>will return information about memory.

0

All Articles