Monitoring a single process in solaris

Hi All,
I need help to monitor a single process in solaris to identify if it leaks memory or is using up too much system resources. I need to collect data over a period of time and plot graph for that single process

I tried using SAR & GNOME-perfmeter but both of them give me performance metrics for all processes running on the OS. There is no way I can use them to monitor a single process

vmstat & iostat give a cumulative output in one shot for the entire system, not process specific

I tried "prstat -L -p <processid> 30 > /tmp/sample.out", so that every 30 seconds sample are collected and written to sample.out file. But the disadvantage is that it does not have timestamp for us to know when a problem occured, if there is a memory leak.

Prstat seems the best as of now from my investigation, but it has no timestamp to be able to plot graph for the statistics collected. Can you please suggest if there are any more similar tools to monitor a single process over a period of time for memory leaks?
Thanks in advance for your support

Regards,
Jayana

take a look at this thread on prstat

also if you

in a loop
   prstat -L -p <processid> 1 1
   will collect for one second
   direct this to temp file
   combine this data with current data/time writing to another file
   wait 30 seconds

I know I did not write the code, but perhaps this 'thought' can get you going on a Friday afternoon.

#!/bin/sh
#Untested top-of-my-head code!
while [ 1 ]
do
echo "`date` - `ps -lfy -p <PID>|tail -1`" >> /tmp/ps.log
sleep 30
done

if it is solaris 10, you can use "dtrace" to get all the information you need.

http://www.brendangregg.com/DTrace/dtrace_oneliners.txt
DTrace Tools