Memory leeks

Memory leeks

Post by Ivan V. Murash » Sat, 15 Jul 2000 04:00:00



Can anybody help me to find any  means for finding memory leeks in
programs

I have insure 5.1 but I have not license for it
--
Best regards,

 
 
 

Memory leeks

Post by Kaz Kylhe » Sat, 15 Jul 2000 04:00:00



Quote:>Can anybody help me to find any  means for finding memory leeks in
>programs

Link to a debugging allocator library, like dmalloc.

--
#exclude <windows.h>

 
 
 

Memory leeks

Post by Norbert Jansse » Sat, 15 Jul 2000 04:00:00




> >Can anybody help me to find any  means for finding memory leeks in
> >programs

> Link to a debugging allocator library, like dmalloc.

> --
> #exclude <windows.h>

Try ElectricFence
--

With kind regards,

########################################################################
Norbert Janssen       Oce Technologies B.V.     phone: (+31)-77-359-3599
                      R&D EI1 3G55              fax:   (+31)-77-359-5473

########################################################################

 
 
 

Memory leeks

Post by Kaz Kylhe » Sat, 15 Jul 2000 04:00:00





>> >Can anybody help me to find any  means for finding memory leeks in
>> >programs

>> Link to a debugging allocator library, like dmalloc.

>Try ElectricFence

ElectricFence is for finding memory overruns and underruns, not leaks.

--
#exclude <windows.h>

 
 
 

Memory leeks

Post by oofoof.. » Wed, 19 Jul 2000 04:00:00






> >Can anybody help me to find any  means for finding memory leeks in
> >programs

> Link to a debugging allocator library, like dmalloc.

> --
> #exclude <windows.h>

The main problem with dmalloc is that it does not provide a stack trace
-
it can only give the location of the source line that invoked malloc().
That
info is useless if several functions call a fuction called getmem()
which
in turn does the malloc() - how then, do you find the source code that
is causing the leaks? It would be great if dmalloc could provide a
complete
stack trace.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Memory leeks

Post by Kaz Kylhe » Wed, 19 Jul 2000 04:00:00








>> >Can anybody help me to find any  means for finding memory leeks in
>> >programs

>> Link to a debugging allocator library, like dmalloc.

>> --
>> #exclude <windows.h>

>The main problem with dmalloc is that it does not provide a stack trace
>-
>it can only give the location of the source line that invoked malloc().
>That
>info is useless if several functions call a fuction called getmem()
>which
>in turn does the malloc() - how then, do you find the source code that
>is causing the leaks? It would be great if dmalloc could provide a
>complete
>stack trace.

Well, for that you should write to the dmalloc maintainers.  Dmalloc is a
fairly portable library, and the means for obtaining a strack trace differs
from platform to platform; that could be the reason why it's not yet included
as a feature.

--
#exclude <windows.h>

 
 
 

Memory leeks

Post by Nate Eldredg » Wed, 19 Jul 2000 04:00:00







> > >Can anybody help me to find any  means for finding memory leeks in
> > >programs

> > Link to a debugging allocator library, like dmalloc.

> > --
> > #exclude <windows.h>

> The main problem with dmalloc is that it does not provide a stack trace
> -
> it can only give the location of the source line that invoked malloc().
> That
> info is useless if several functions call a fuction called getmem()
> which
> in turn does the malloc() - how then, do you find the source code that
> is causing the leaks? It would be great if dmalloc could provide a
> complete
> stack trace.

A malloc de* I wrote, called YAMD, does this and more.

http://www.veryComputer.com/~neldredge/yamd/

--

Nate Eldredge

 
 
 

Memory leeks

Post by Chance Harri » Wed, 19 Jul 2000 04:00:00






:>> >Can anybody help me to find any  means for finding memory leeks in
:>> >programs
:>>
:>> Link to a debugging allocator library, like dmalloc.
:>>
:>> --
:>> #exclude <windows.h>
:>>
:>The main problem with dmalloc is that it does not provide a stack trace
:>-
:>it can only give the location of the source line that invoked malloc().
:>That
:>info is useless if several functions call a fuction called getmem()
:>which
:>in turn does the malloc() - how then, do you find the source code that
:>is causing the leaks? It would be great if dmalloc could provide a
:>complete
:>stack trace.

: Well, for that you should write to the dmalloc maintainers.  Dmalloc is a
: fairly portable library, and the means for obtaining a strack trace differs
: from platform to platform; that could be the reason why it's not yet included
: as a feature.

I wrote a really cheesy hack to get around this. I wrote code that went
through all the source and inserted POP and PUSH type statements at
the beggining of every function, at the end of every function and every
time a return statment was made. That I plugged that down into my fake malloc.
Another good thing is to sequentially number all your mallocs, then you
can at least find where it occurred in log(n) time.

I don't recommend this approach, but as a last resort you can do it yourself.
If somebody wants it, I'll ask around and see if I can release this code.
(I don't think it would be a problem, but I can't really see anybody wanting
it either). It is at least a portable solution.

There has got to be a more elegant way to do this with gcc. I just didn't
have time to figure it out.