Malloc issue

Thompson Harmon [US], Stanley W. Stanley.Harmon at sperry.ngc.com
Fri Aug 4 08:40:18 PDT 2006


All,

   My system (buildroot 20060727, busybox 1.1.3, uClibc snapshot from
20060727, and gcc 4.0.0 with Ada) keeps running out of memory.  To
obtain a better understanding of my problem I created an Ada test
program which attempts to create 10,000 41 byte objects.  The Ada "new"
becomes a simple-malloc (alloc.c in libc/stdlib/malloc-simple directory)
in uClibc of 48 bytes (41 requested bytes + 3 bytes to round to 32 bit
boundary + 4 bytes overhead for sizeof(size_t)).  Now, just because it
is possible to do this, I also compiled the Ada test program statically
on a Fedora Core 4 box. The results are puzzling me.  The static Fedora
Core 4 Ada test application running on my target allocates (according to
/proc/meminfo MemFree) 784kB (approximately 80.282 bytes / object).  The
dynamic uClibc Ada test application running on my target allocates
(according to /proc/meminfo MemFree) 120,120kB (approximately 12.012kB /
object).  So, my questions are: Why is there such a memory difference?
Is it possible to get rid of this difference?  I have attached my uClibc
configuration file to this message.

Please let me know if further information is needed.

Thanks,
Stan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: uClibc.config_using_malloc_simple
Type: application/octet-stream
Size: 4679 bytes
Desc: uClibc.config_using_malloc_simple
Url : http://busybox.net/lists/uclibc/attachments/20060804/d9b3dcaa/attachment.obj 


More information about the uClibc mailing list