memory leaks

G

Grahamo

Hi,

I'm hoping to get some feedback from users regarding heap analysis
tools available (apart from purify) for leak tracking. I'm working with
a large, already deployed codebase that needs fixing. the problem is
that the compiler in question (borland c++ on windows) doesn't support
purify which is my first choice.

I'd like to know what the best alternatives are. I've heard of
boundschecker, smartheap and such like. Before I try any of them I'd
like to know what products are preferred by users/developers. Any
feedback would be most appreciated.


thanks and have a nice day.

Graham
 
N

Niels Dybdahl

I'm hoping to get some feedback from users regarding heap analysis
tools available (apart from purify) for leak tracking. I'm working with
a large, already deployed codebase that needs fixing. the problem is
that the compiler in question (borland c++ on windows) doesn't support
purify which is my first choice.

I'd like to know what the best alternatives are. I've heard of
boundschecker, smartheap and such like. Before I try any of them I'd
like to know what products are preferred by users/developers. Any
feedback would be most appreciated.

I have been using boundschecker several times, mostly for finding buffer
overflows and dangling pointers and often with good results. The memory leak
functionality seems to be ok, but I have hardly used that part of
Boundschecker.

Niels Dybdahl
 
A

Aleksey Loginov

Hi,

I'm hoping to get some feedback from users regarding heap analysis
tools available (apart from purify) for leak tracking. I'm working with
a large, already deployed codebase that needs fixing. the problem is
that the compiler in question (borland c++ on windows) doesn't support
purify which is my first choice.

if code doesn't use placement new, you can try

void * operator new ( size_t s, const char * file, int line ) {
void * ptr = ::eek:perator new(s);
cout << file << ":" << line << ": new " << ptr << endl;
return ptr;
}
void * operator new [] ( size_t s, const char * file, int line ) {
void * ptr = ::eek:perator new [] (s);
cout << file << ":" << line << ": new [] " << ptr << endl;
return ptr;
}

void operator delete ( void * ptr, const char * file, int line ) {
cout << file << ":" << line << ": delete " << ptr << endl;
::eek:perator delete (ptr);
}

void operator delete [] ( void * ptr, const char * file, int line ) {
cout << file << ":" << line << ": delete " << ptr << endl;
::eek:perator delete [] (ptr);
}

#define NEW new
#define new NEW (__FILE__,__LINE__)
#define DELETE delete
#define delete(p) operator DELETE ((p),__FILE__,__LINE__)
I'd like to know what the best alternatives are. I've heard of
boundschecker, smartheap and such like. Before I try any of them I'd
like to know what products are preferred by users/developers. Any
feedback would be most appreciated.

don't know
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top