Link to home
Create AccountLog in
Avatar of tittu
tittu

asked on

How to detect memory leaks using Dtrace in C++ code on Solaris sparc 10 Platform

i am working on production system of Solaris 10 Sparc platform there was no access to source code and hence compilation was not possible , i googled and found Dtrace is the right tool to detect memory leaks on a production systems, is there any example script to identify memory leaks , i googled and downloaded sample scripts but not working
ASKER CERTIFIED SOLUTION
Avatar of Brian Utterback
Brian Utterback
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
But now that I think of it, once you find the leak, what do you plan on doing, if you can't recompile? If you want more help on the dtrace script though, it would help if you loaded the scripts or provided pointers to where you got them.
If you want to know what program has the problem, then all you have to do is run top and look how much ram each program consumes, and then keep an eye on it over time to see which program(s) are growing.

It is a low-tech method, but will absolutely tell you what program(s) are leaking.  I had a similar problem with an app running on my Mac. I didn't have source code, but was able to prove to the author that their code leaked, which was good enough to get them to fix the problem.  As Blu pointed out, finding the app is only half the battle, since you don't have source. So by using something simple like top, you can certainly prove to the author that they have an issue.

(and top doesn't care what language the code was written in)
Avatar of tittu
tittu

ASKER

Tried and working