Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|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
add comment

2 Answers

up vote 0 down vote accepted

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

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

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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