topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday October 5, 2024, 8:39 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

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

gjehle

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
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,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
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/d...AGX23&S_CMP=DWNL
(i thought they stopped making this but maybe they haven't?)

AutomatedAQ:
AQTime: http://www.automated...cts/aqtime/index.asp

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

gjehle

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
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
    • View Profile
    • Donate to Member
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

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
@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
    • View Profile
    • Donate to Member
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

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
DJMusic: we're talking application memory leaking here, not "can it get through my firewall" testing.
- carpe noctem

Eóin

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
For MSVC and C++ you can use the free Visual Leak Detector.

nevf

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 115
    • View Profile
    • Clibu, accessible knowledge
    • Donate to Member
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,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Glowcode was one of the ones i was trying to remember the name of  :up:

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Heavy pricetag... but less heavy than BoundsChecker, I guess :|
- carpe noctem

gjehle

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
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 ;-)