Detect memory leaks

M

mircu

Hi,
I need a tool to check my applicationm for memory leaks. It uses mixed
code and for now I didn't find proper tool. My application is managed
c++ app and it uses mc++ wrappers for my unmanaged code (which uses
MFC). When I stop debugging there is info about memory leaks but I'm
sure that every wrappers deletes unmanaged objects in finalizers. So
maybe the finalizers aren't called? Is there a tool which could show me
leaked objects in mixed mode application? Raional Purify Plus can't
check it.

Regards,
mircu
 
J

Jochen Kalmbach

mircu said:
When I stop debugging there is info about memory leaks but I'm
sure that every wrappers deletes unmanaged objects in finalizers. So
maybe the finalizers aren't called?

As a design suggestion: You should normally not use Finalizers!
Please use the IDisposable Interface/Pattern.

Is there a tool which could show me
leaked objects in mixed mode application? Raional Purify Plus can't
check it.

You can try my LeakFinder: http://www.codeproject.com/tools/leakfinder.asp
It will only show you unmanaged CRT-Leaks.


--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp

Do you need daily reports from your server ?
http://sourceforge.net/projects/srvreport/
 
M

mircu

Jochen said:
As a design suggestion: You should normally not use Finalizers!
Please use the IDisposable Interface/Pattern.

When I started coding I followed the guide MS "Managed Extensions for
C++ Migration Guide" and there were deleting objects in destructors
(finalizers). When I'll be little less busy I'll apply Dispose pattern.
You can try my LeakFinder: http://www.codeproject.com/tools/leakfinder.asp
It will only show you unmanaged CRT-Leaks.

Thanks! It found some leaks but why there are I don't know. Could they
be reported because the memory leak checker is called before garbage
collector thread finishes?

Regards,
mircu
 

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

Top