5

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.

2 Answers 2

3

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".

5
  • 2
    Useless use of cat. Commented Mar 16, 2010 at 21:43
  • This seems most interesting approach. 1) What I need installed on CentOS for graph to work? 2) Why cat is useless? Commented Mar 17, 2010 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. Commented Mar 17, 2010 at 21:23
  • Fixed "useless use of cat" Commented Mar 18, 2010 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. Commented Mar 18, 2010 at 18:39
0

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

2
  • Can it monitor a single process? Commented Mar 17, 2010 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. Commented Mar 17, 2010 at 15:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.