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

I'm trying to diagnose a memory leak in a process, and looking for a tool to graph its memory usage over time.

Is there any tool on Linux that supports diagramming in a form similar to Windows PerfMon?

I tried using IBM virtual assistant, but it works only on 32-bit, while I have 64-bit platform.

Thanks.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Quick hack:

for((i=0;;++i)) { echo $i ` grep VmSize /proc/\`pidof firefox-bin\`/status | grep -o '[0-9]*'`; sleep 1 || break; } > data
^C
graph -T X data

The same could be done for things other than "VmSize".

share|improve this answer
2  
Useless use of cat. –  Dennis Williamson Mar 16 '10 at 21:43
    
This seems most interesting approach. 1) What I need installed on CentOS for graph to work? 2) Why cat is useless? –  SyRenity Mar 17 '10 at 12:18
    
Actually, from what I read so far VMSize seems to show only part of the picture. So far the most useful tool for me was ps_mem from here (pixelbeat.org/scripts/ps_mem.py). The only question is how to plot the resulting graph - I just can't find this "graph" tool on Linux. –  SyRenity Mar 17 '10 at 21:23
    
Fixed "useless use of cat" –  Vi. Mar 18 '10 at 18:37
    
graph is from plotutils package on Debian. For CentOS it should be something like dag.wieers.com/rpm/packages/plotutils You can also request -T svg instead of -T X if you want to insert the plot somewhere. –  Vi. Mar 18 '10 at 18:39

We use Cacti, which is the next gen MRTG, to graph system memory usage.

share|improve this answer
    
Can it monitor a single process? –  SyRenity Mar 17 '10 at 12:17
    
To monitor a single process, see the documentation on SNMP for adding a custom command to the SNMP values. The use something like ps with grep and/or awk to find the memory values for your process and output it as a value. Then in Cacti, graph this value as a gauge. –  Walter Mar 17 '10 at 15:43

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.