DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Leak-testing / Memory Profiling Question: What tools can you recommended?  (Read 19,622 times)

gjehle

  • lonesome linux warrior
  • Member
  • Joined in 2006
  • **
  • Posts: 286
    • Gathering Badge
Hey there fellow DC'ers
I'm sitting at work here right now, having to deal with a _very_ nasty problem that totally smashes my system's heap, slowly, very slowly... (to the point of no return other than rebooting)
The application is an especially nasty accumulation of C/C++/Managed C++/C# code.
So it got everything, from malloc to new to gcnew.. garbage collected items, and items that need manual disposal.
Everything split up in half a ton of DLL files.

I already found this thread here and was wondering if any of you could recommend any other tools (preferably free software, but if it's payware, whatever, as long as it does the job) to do leak testing, memory profiling.

linux-based valgrind is pretty awesome for this, but well, linux.
i'd need something similar for win2k and xp.

i know leaks are a very common problem to any non-trivial program, so i assume most of you have already had to deal with this problem.
please share your knowledge :D

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
ok so you mentioned valgrind, which is the well known generic one for c++.  there are a couple more open source c++ tools inspired by valgrind; they are all sort of semi-work-in-progress, and won't be the most convenient or intuitive for win32 gui types.

a few i have tried in the past:

Rational Purify: http://www.ibm.com/developerworks/downloads/r/rpp/?S_TACT=105AGX23&S_CMP=DWNL
(i thought they stopped making this but maybe they haven't?)

AutomatedAQ:
AQTime: http://www.automatedqa.com/products/aqtime/index.asp

There are 2 more i'm trying to remember and i will post them as i do.

gjehle

  • lonesome linux warrior
  • Member
  • Joined in 2006
  • **
  • Posts: 286
    • Gathering Badge
thanks for the reply mouser,
since i'm not the GUI-type but usually a linux-only user (except for prostitution work related stuff) this shouldn't pose a problem.
i found AQTime myself after some searching and i have to say it looks quite nice.
turns out... there's no real memory leak after all :( *curses at image acquisition drivers*

mwb1100

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,645
If you're using MSVC, there are some primitive, but effective (and free, if you already have Visual Studio) built-in tools in the debug run-time.  Do a search (Google or MSDN) for "CRTDBG" or look in the crtdbg.h file for pointers to how to enable the debug heap.

When enabled, it keeps track of where all allocations occur, and will dump information about any outstanding allocations when the program ends. 

gjehle

  • lonesome linux warrior
  • Member
  • Joined in 2006
  • **
  • Posts: 286
    • Gathering Badge
@mwb1100

CRTDBG is a rather blunt tool ;-) pretty much telling me: you leak / you don't leak
and I'm not sure it works cross-dll / cross-language

anyways, thanks for the info

DJMusic

  • Participant
  • Joined in 2007
  • *
  • Posts: 5
For leaktesting I use Leaktest from GRC. The Microsoft Baseline Security Analyzer is also a good shot, but it eats waaaay too much CPU.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
DJMusic: we're talking application memory leaking here, not "can it get through my firewall" testing.
- carpe noctem

Eóin

  • O'Callaghan
  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
For MSVC and C++ you can use the free Visual Leak Detector.
Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.

nevf

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 115
Glowcode my meet your needs. It has worked well for me over the years. www.glowcode.com
Neville Franks, Clibu a better way to collect, use, manage and share information across all devices.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Glowcode was one of the ones i was trying to remember the name of  :up:

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Heavy pricetag... but less heavy than BoundsChecker, I guess :|
- carpe noctem

gjehle

  • lonesome linux warrior
  • Member
  • Joined in 2006
  • **
  • Posts: 286
    • Gathering Badge
Glowcode my meet your needs. It has worked well for me over the years. www.glowcode.com

i tried that one, and it worked reasonably well :)

Glowcode was one of the ones i was trying to remember the name of  :up:

yup, found that one too, but that's quite an investment ;-)

Original address: https://www.donationcoder.com/forum/index.php?topic=10205.0