1

Possible Duplicate:
Measuring RAM usage of a program

I have a process, which is quite short-running (about 10 minutes), but memory heavy.

I want to know how much memory does the process uses at its peak. I want some way to track it, more efficient than running htop and writing down the memory usage every 20 seconds.

Ideally, I would like something like time - some way to write

trackmemory command

and the command would run and at the end, the memory usage would be shown. However, I will survive manually writing the pid somewhere; I just don't want to watch htop and writing it down.

Karel Bílek
  • 1,951

1 Answers1

2

I found out this answer Measuring RAM usage of a program

but that actually didn't work so well, because it shows me unrealistic numbers (memory 10 times higher than RAM+Swap together). What I did was

top -bp pid > memories

and then I filter the memories file using grep, sed and sort. It works quite well.

Karel Bílek
  • 1,951