Memory leaks

A

Al Klein

Can anyone recommend a program which detects memory leaks?

Task manager/notepad. Note the amount of memory being used. Run the
suspect program for a while. Close it. Not the amount of memory
being used. If the program doesn't leave any dlls resident, the
memory being used should be the same before and after.

Memory leaks during run? If the program crashes with an "out of
memory" error, there's probably a memory leak.
 
F

Fred

Al Klein said:
Task manager/notepad. Note the amount of memory being used. Run the
suspect program for a while. Close it. Not the amount of memory
being used. If the program doesn't leave any dlls resident, the
memory being used should be the same before and after.

Memory leaks during run? If the program crashes with an "out of
memory" error, there's probably a memory leak.

Trouble is I have quite a few programs at any one time and it would be nice
to know which programs grab memory and then don't release it.
 
K

Kerodo

Trouble is I have quite a few programs at any one time and it would be nice
to know which programs grab memory and then don't release it.

Sometimes it's hard to tell what's going on. A program can eat memory
and it shows up in Task Manager so you can see it. Other times a
program will eat memory and then when you exit it won't release it all
and you're left with less system ram. This is quite common, especially
in programs that scan your HD, i.e. AVs, anti-spyware scanners, etc. If
you suspect something is amiss, it's best to test one prog at a time.
Otherwise you'll never know which is doing what. There are some ways to
track memory usage and leaks in Win2k and XP, but I don't know much
about it beyond the fact that it's possible. I'd suggest taking a look
at the Microsoft site or Google for more info.
 
F

Fred

Kerodo said:
Sometimes it's hard to tell what's going on. A program can eat memory
and it shows up in Task Manager so you can see it. Other times a
program will eat memory and then when you exit it won't release it all
and you're left with less system ram. This is quite common, especially
in programs that scan your HD, i.e. AVs, anti-spyware scanners, etc. If
you suspect something is amiss, it's best to test one prog at a time.
Otherwise you'll never know which is doing what. There are some ways to
track memory usage and leaks in Win2k and XP, but I don't know much
about it beyond the fact that it's possible. I'd suggest taking a look
at the Microsoft site or Google for more info.

Many thanks. I was wondering if there was a utility which kept track of
memory use and could tell when a program didn't release it. I suppose if it
was that simple MS would have thought of that one themselves.
 
M

meow2222

Many thanks. I was wondering if there was a utility which kept track of
memory use and could tell when a program didn't release it. I suppose if it
was that simple MS would have thought of that one themselves.

Nice idea. The one time I tried to monitor what was going on with RAM
use on a 98 system, to try and track down the source of crashes, the
numbers seemed to not match more often than match, the whole show
seemed to be either a mess or not comprehensible. I wouldnt be
surprised if this would make such a util unproductive in practice.
But... I dont really know either.


NT
 
B

B. R. 'BeAr' Ederson

Many thanks. I was wondering if there was a utility which kept track of
memory use and could tell when a program didn't release it. I suppose if it
was that simple MS would have thought of that one themselves.

Sure they have. You'll find the DH (Display Heap) and the Heapmon tools
inside some Windows resource kits, for instance. And there are other
utilities for that purpose. But the real good ones which are easily
set up and do a semi-automatic analysis are (very expensive!) payware.

Microsoft usually only provides tools for Geeks, when expensive payware
is available. Sometimes they even license slimmed-down versions of these
tools and bundle them with their development suites.

I don't know any free tool which could be used by a beginner. And the
other ones are too complicated and dangerous to suggest them.

If you only wanted to test a program you wrote yourself, than you ought
to use the profiling capabilities of your IDE (if any), first. Or you
could link your program with special libraries like the one of the
MPatrol project:

http://www.cbmamiga.demon.co.uk/mpatrol

Hope, you can get an idea of the basic concepts from my notes...
BeAr
 
M

meow2222

Fred said:
Can anyone recommend a program which detects memory leaks?

I've never used any of these, so who knows...

AbleSpeed
http://www.all4you.dk/FreewareWorld/links.php?go=27184

Advanced Ram Recovery
http://www.all4you.dk/FreewareWorld/links.php?go=23141

Aldos Free Memory
http://www.all4you.dk/FreewareWorld/links.php?go=5430

Fast Defrag 2 Standard (Std)
- which afaics does everything _except_ defrag
http://www.all4you.dk/FreewareWorld/links.php?go=9187

AquiMem


good luck

NT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top