I'm trying to find memory usage stats for processes after they finish (on Linux). Is there a way to do this?

I know I can get this data while a process is running by looking in /proc/{id}/status, but that file is gone after the process dies.

link|improve this question
Why not doing it while the process is running? – Khaled Nov 23 '10 at 8:10
Maybe he's trying to find out why it died. – Stefan Wolff Nov 23 '10 at 13:30
I'm trying to include memory-usage in some benchmark data (from another program that starts these up), but I won't know the real peak usage till after the processes die. – Adam Wagner Nov 23 '10 at 15:23
feedback

2 Answers

up vote 0 down vote accepted

How about this: http://tstarling.com/blog/2010/06/measuring-memory-usage-with-strace/

link|improve this answer
I think I can use that, thanks. – Adam Wagner Nov 23 '10 at 19:21
feedback

atop has a daemon mode, which will log various kinds of resource use by individual processes.

The debian package runs it as /usr/bin/atop -a -w /var/log/atop.log 600. You can access the data with sudo atop -r, and navigate to a time the system was loaded, or your application died, using t and T. There are various ways to present the data as well, similar to other top tools.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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