Memory leak detection under WIndows

General questions regarding the usage of CodeLite
coder99
CodeLite Expert
Posts: 167
Joined: Wed Oct 22, 2008 6:50 am
Contact:

Memory leak detection under WIndows

Post by coder99 »

One of the reasons I am still working with MSVC is that it includes fairly good support for memory leak detection.

I have looked around for open source replacements for this to use with CL.
Before I start my own search and experiments, does anyone have any recommendations or comments?

TIA

Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2

frank_frl
CodeLite Expert
Posts: 176
Joined: Sun Aug 17, 2008 2:45 pm
Contact:

Re: Memory leak detection under WIndows

Post by frank_frl »

First of all is it a good practice to write the appendant free or delete right after allocating memory. ;)

Frank
sdolim
CodeLite Veteran
Posts: 69
Joined: Fri Oct 24, 2008 10:29 pm
Contact:

Re: Memory leak detection under WIndows

Post by sdolim »

This post at stackoverflow.com has a lot of useful suggestions for this question:

http://stackoverflow.com/questions/4562 ... naged-code

One free tool mentioned on that page that might be very helpful is DebugDiag from Microsoft:

http://www.microsoft.com/downloadS/deta ... laylang=en

The blurb on the tool's home page says this:
The Debug Diagnostic Tool (DebugDiag) is designed to assist in troubleshooting issues such as hangs, slow performance, memory leaks or fragmentation, and crashes in any Win32 user-mode process.
It appears you don't have to instrument your code. Haven't tried it yet myself, but I think I'm going to.
coder99
CodeLite Expert
Posts: 167
Joined: Wed Oct 22, 2008 6:50 am
Contact:

Re: Memory leak detection under WIndows

Post by coder99 »

Wish things were so simple to follow frank_frl' s advice ;-)

I've had a brief look at the stackoverflow commentary and I have used/heard of several of the products described, but I was hoping for some comments from people using CL as to what they have found useful or useless :-).

I will give some of the recommended product a bit of a try, if I find the time to get them installed and working.

At present it is far easier for me to try and keep a parallel MSVC project going and to switch to it for some testing. Might have to dust off some of my own old code and polish it up.

Unfortunately it looks like the wxWidgets stuff does not work with MINGW :-(
Oh well, ......

Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2

marfi
CodeLite Expert
Posts: 159
Joined: Mon Nov 03, 2008 9:17 pm
Contact:

Re: Memory leak detection under WIndows

Post by marfi »

Hi, I use Valgrind ( together with its GUI called Valkyrie ) on Linux. It works (slowly, but works ;) with console apps as well as with wxWidgets. It would be a nice to integrate it with CL. Unfortunately, it is not designed for MS Windows...
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Memory leak detection under WIndows

Post by eranif »

marfi wrote:Hi, I use Valgrind ( together with its GUI called Valkyrie ) on Linux. It works (slowly, but works ;) with console apps as well as with wxWidgets. It would be a nice to integrate it with CL. Unfortunately, it is not designed for MS Windows...
I am familiar with valgrind and I am working with it at work. However, since it does not cross platform, I avoided making a plugin for it

Eran
Make sure you have read the HOW TO POST thread
coder99
CodeLite Expert
Posts: 167
Joined: Wed Oct 22, 2008 6:50 am
Contact:

Re: Memory leak detection under WIndows

Post by coder99 »

I had heard of it but since it won't run under Windows, I sort of left it alone :-(

But I'll keep looking and trying

Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2

Post Reply