views:

288

answers:

3

I have an application that keeps using up more and more memory as time goes by (while actively running), but there are no leaks. So I know the program isn't doing something totally wrong, which would be easy to find.

Instead I want to track allocations so I can start tracking down the issue, and on a Mac I'd use Instruments, which gives a detailed profile of what objects have been allocated, and by whom, but on Windows what would I use?

Currently I'm working with C/C++ on Windows XP, using VS2005. So any tools for this setup would be great, and hopefully tools that are free or at least provide a few weeks of trial, because it'll take a while to complete any purchase (corporate stuff) if necessary, and I have deadlines.

Thanks!

Edit: I'm using VLD, so I know the program has no Leaks, but it seems to be hogging more memory than needed, and not returning it, so I need to track allocations, not leaks.

+1  A: 

Glowcode is here. It has the worst user interface in the world. The internals have the stuff though, if you have the patience to struggle through the horror that is trying to get it to work right. There is a 21 day free trial. I've found it to be a lifesaver, but you really have to want to find that bug.

1800 INFORMATION
After trying Glowcode out, I remember I'd used it about 4 years ago, but seems like it hasn't changed much since then :) Anyways it works, but Canopus MemoryValidator has a much friendlier UI
Robert Gould
If anything it has gotten worse. I kind of like it though. I think I have debugger Stockholm syndrome
1800 INFORMATION
A: 

Visual Studio Enabling Memory Leak Detection

The primary tools for detecting memory leaks are the debugger and the CRT debug heap functions. To enable the debug heap functions, include the following statements in your program:

#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

http://msdn.microsoft.com/en-us/library/e5ewb1h3(VS.71).aspx

Unknown
Will this help if there are no actual memory leaks? I think he is talking about a situation of increasing memory usage over time, not necessarily a leak
1800 INFORMATION
Sorry but I'm not talking about memory Leaks, my program cleans itself perfectly when it finishes, no leaks what so ever. The issue is it keeps allocating and allocating but doesn't return memory until it exits, or something like that.
Robert Gould
+2  A: 

Memory validator would be ideal for you. http://www.softwareverify.com/cpp/memory/index.html

Canopus
Great tool! Just what I needed, thanks
Robert Gould