[uClibc]Re: malloc, munmap, etc...

Jon Nelson jnelson at jamponi.net
Wed Dec 4 14:31:47 UTC 2002


On 04 Dec 2002 13:45:19 +0900
Miles Bader <miles at lsi.nec.co.jp> wrote:

> Jon Nelson <jnelson at jamponi.net> writes:
> > One thing I feel I should note is that Boa has been gone over a dozen
> > times with dmalloc, valgrind, and other memory utilities, and as far
> > as I can tell, there are no issues inside Boa directly -- no double
> > munmapping, nada.  However, there are several "leaks" that are
> > actually part of glibc (possibly uClibc as well -- haven't tried),
> > that are one-time allocations.
> 
> I'm not sure what you by `leak' here -- libc uses malloc for its own
> purposes, and in some cases that memory may not be freed (though it's
> really not a leak, since it's intentional).  I expect uClibc is a bit
> better in this respect.

Right - that's why it was in quotes (I shhould have made that
clearer).

> The other thing that may contribute to memory usage, but which is still
> arguably not a leak, is heap fragmentation.  This varies widely
> depending on how the application uses malloc/free, and is probably
> impossible to get rid of entirely, but seeing some debugging output
> might help identify pathological cases.

Ah, interesting!  I wonder if dmalloc or valgrind have heap
fragmentation detector thingies. Hmmmmmm.


-- 
"Fig Newton: The force required to accelerate a fig 39.37 inches/sec."
 - J. Hart

Jon Nelson <jnelson at jamponi.net>
C and Python Code Gardener



More information about the uClibc mailing list