teZeriusz
teZeriusz

Reputation: 91

C++ app on SunOS has a memory leak. How to find it?

i just landed on SunOS:

$ uname -a
SunOS sunfi95 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire-880

and have Sun studio:

$ CC -V
CC: Sun C++ 5.8 2005/10/13

How I can find memleaks in code? (dbx is not a option in this case). Valgrind does not work on sparc systems, only one solution that cross my mind is to use some smart lib that will overload new and delete and count how many times they are called. Anyone know something that is on BSD like license?

Upvotes: 0

Views: 2201

Answers (4)

Thomas Owens
Thomas Owens

Reputation: 116169

You can also use an application called cppcheck to find memory leaks, as well as a number of other problems. It's a free/open source product.

I've never used it on SunOS or Sparc machines, but the source is available and you could try to build it. I'm not sure what goes on under the hood, but I don't see why you couldn't build it on a SunOS Sparc machine.

Upvotes: 1

Ben Summers
Ben Summers

Reputation: 91

DTrace can be very useful for working out what's going on in Solaris applications.

Here's an example of how to use it from Sun.

Upvotes: 2

yoco
yoco

Reputation: 1424

On Sun OS you can use Purify, or try to port(generally you'll port the leak, too) your program to Unix/Linux and use valgrind to find the leak.

Upvotes: 4

David Allan Finch
David Allan Finch

Reputation: 1424

I think there are freeware libs but we use Purify on Solaris which works well.

Upvotes: 1

Related Questions