Re: [SYSTEM-LINUX] Finding Memory Leaks : Help please.

From: George Greer (
Date: 01/31/02

On Fri, 1 Feb 2002, Justin Adler wrote:

>>> See sysdep.h in bpl20.
>   Checks for MALLOC .. Wow. Kewl. A huge descriptive Comment. Thank you
>guys. Lovely effort.
>#define CIRCLE_GNU_LIBC_MEMORY_TRACK    0       /* 0 = off, 1 = on */
>Should i turn this on for checking? or/and do the two SHELL commands?

It's for memory leaks.  You need the #define and the two shell commands to
actually make it do anything.  I recommend piping the second one into
'less' or 'more' if you expect a lot of leaks.

You can also do:

  MALLOC_CHECK_=1 bin/circle

to make it sanity check the malloc structures to avoid crashing in free()
but a) it probably won't work simultaneously with memory tracing and b) it
still won't tell you the cause, only the symptom.

>>> Run ElectricFence. (Makefile: "LIBS = -lefence")
>Hmmm .. rings a bell ... yeah . i think i tried this before in the past and
>had some troubles ... lets see what happens when i do it this time...
>ElectricFence Exiting: mmap() failed: Cannot allocate memory

It works for me so I'm not sure why not for you.  Maybe mini-mud will be

George Greer

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT