-
July 1st, 2011, 04:38 PM
#1
Memory leak detection tool with Windows7 64 bit Visual Studio
Hello There,
I have been through reading on what is available and would like to get some advise on tools you would recommend to find memory few leaks. My all time favorite is TotalView (it finds leaks in a click and shows the exact source line where the object was allocated - and works only on linux).
I do need something else.
The server application I am debugging runs about 300 threads at the same time, binds to 3 TCP ports and also does some network communication as client. It has a console GUI and a huge log file hard to follow. The problem is that it leaks memory - sometime. So there are requests which are served flawlessly but some leak for some reason.
What I am after:
1) Runs (and it is said to run) on windows 7 with Visual Studio 2010 (binaries built by VS2010 and pdb files it generated). That gets about 90% of tools excluded since most stopped with (or before) Vista/Visual Studio 2008 support.
2) It gets to the line in the source code where the leaking object was allocated when the debugged application is stopped/paused. Click in the GUI of the tool and job done. Simple. Easy.
3) There is no need for code insertion/inclusion of any extra header nor special build except for a debug build.
4) Have the least features except for memory leak detection.
What I found so far:
1) About 10 tools what do not work/crash.
2) Glow Code is the only one what works to some extent. It shows a number it says memory leaks detected. Right click on its Show source loads the class it identifies as leaking however - without getting to a line where the allocation was done. It is not very helpful when the file is over 2,000 lines long.
The rest of tools quoted in different forums/different discussions just did not work (some did not even start on windows 7).
3) An announcement that BoundsChecker will be sold over again so it is not convincing.
4) A few words on Insure++ (I did not try that particular one).
Thanks
-
July 1st, 2011, 05:27 PM
#2
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
Originally Posted by luftwaffe
Hello There,
I have been through reading on what is available and would like to get some advise on tools you would recommend to find memory few leaks.
Unfortunately, there aren't a lot of tools for 64-bit leak detection. Most of the major players such as Purify and BoundsChecker are stuck in the 32-bit world with their current Windows software.
I don't know if Insure++ has a 64-bit version, but get ready to pay about twice as much as for Purify or BoundsChecker. That product is one of the most, if not most expensive tool out of the bunch. It's a good product, but the price is prohibitive (if price is important).
Regards,
Paul McKenzie
-
September 3rd, 2014, 10:35 AM
#3
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
Originally Posted by Paul McKenzie
Unfortunately, there aren't a lot of tools for 64-bit leak detection.
Deleaker supports x64 now.
-
July 3rd, 2011, 12:48 PM
#4
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
Continuing reading on Isure++, I found: http://www.parasoft.com/jsp/products....jsp?itemId=63
They support up to VS 2008.
Might it be possible that there are no supported memory leak checkers for VS 2010 at all?
-
July 3rd, 2011, 01:44 PM
#5
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
Do you use VC++ built-in memory leaks detection? Using _CrtSetDbgFlag and redefinition of new to DEBUG_NEW gives full list of leaked allocations. It doesn't show call stack - this is the only advantage of another tools like BoundsChecker.
-
July 4th, 2011, 01:05 PM
#6
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
That requires code modification, and that is exactly what I would like to avoid. The code is based on Qt and there is no chance to replace all allocation calls with microsoft specific stuff. Also, code portability is required as platform may change (what I will be recommending anyway if there is not memory debugger available at all).
I am really surprised, TotalView just a couple hundred bucks and does it perfectly on linux. Is it impossible on Windows, or... is it better than actual coding can take longer and requires instrumentation in the code? Hmm, I cannot find the right words to explain - maybe disappointment is a good one. :O
-
July 5th, 2011, 01:20 AM
#7
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
Most Windows leak tracking tools show a huge logs containing a lot of unnecessary statistics, everything you can think about, except your own memory leaks.
In my cross-platform project (UI is written with wxWidgets) I have the following lines in every .cpp file, after all # include lines:
Code:
#ifdef WIN32
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#endif
DEBUG_NEW is defines as:
Code:
#ifdef WIN32
#include "crtdbg.h"
#ifdef _DEBUG
#ifndef DEBUG_NEW
#define DEBUG_NEW new( _NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#else
#ifndef DEBUG_NEW
#define DEBUG_NEW
#endif
#endif
#else
#ifndef DEBUG_NEW
#define DEBUG_NEW
#endif
#endif // WIN32
In the program initialization code:
Code:
#ifdef WIN32
#include <crtdbg.h>
#endif
...
#ifdef WIN32
_CrtSetDbgFlag( _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
#endif
This is quite enough for me to track memory leaks in Windows. I don't use any leak tracking Linux tool since all leaks are detected and fixed in Windows.
-
July 5th, 2011, 03:04 AM
#8
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
Thank you, I will give it a try.
-
January 24th, 2012, 02:40 PM
#9
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
You should use VC++ built-in memory leaks detection or deleaker...
-
January 24th, 2012, 04:23 PM
#10
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
-
January 24th, 2012, 04:57 PM
#11
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
ahoodin
To keep the plot moving, that's why.
-
January 25th, 2012, 12:13 PM
#12
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
Originally Posted by luftwaffe
An announcement that BoundsChecker will be sold over again so it is not convincing.
"Will be sold over again?" We never really stopped, though our former corporate owners certainly seemed to be trying to kill us off...
Anyway, BoundsChecker is part of the DevPartner Studio product, and has been for many years. This product is available from Micro Focus, through Component Source. The current version (10.5.3) runs on Windows from XP X86 SP3 and XP X64 SP2, through Windows 7 X86 and X64 SP1, including server versions of the system. It integrates with Visual Studio 2005, 2008 and 2010, and (minus the integration) supports Visual Studio 6 and 2003. Both 32-bit and 64-bit target processes are supported.
We've been working on bringing the product back to reasonable currency, and expect to ship a new version when Microsoft ships it's next version of Visual Studio. The product works better now than it has in many years, probably since the 2005 time frame.
-
February 29th, 2012, 01:02 PM
#13
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
-
September 12th, 2014, 04:00 PM
#14
Re: Memory leak detection tool with Windows7 64 bit Visual Studio
As AlexF says it's enough to call CrtSetDbgFlag in main to get leakage information. If you wan't to get more information (such as allocation line of code) you have to do the other stuff he mentions
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|