pthread_create fails on a device with 16MB RAM
Alexander Gordeev
lasaine at lvk.cs.msu.su
Fri Jan 28 00:39:55 UTC 2011
Hi!
I have a problem with pthread_create on a device with only 16MB RAM.
strace shows this:
old_mmap(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
instead of (what I obtained on another device with 32MB RAM):
old_mmap(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 2143089904, 0x2b985918) = 0x2bc6b000
mprotect(0x2bc6b000, 4096, PROT_NONE) = 0
clone(child_stack=0x2c46a3b0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x2c46a6f8, tls=0x2c471960, child_tidptr=0) = 1394
which is quite reasonable because 8388608 is greater than half the
amount of available physical memory which AFAIK is a limit for memory
allocations normally. When I did
echo 1 > /proc/sys/vm/overcommit_memory
everything worked like a charm (because this limit was disabled).
How can I tune uClibc to not request so much memory on pthread_create?
--
Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20110128/c33f0140/attachment.asc>
More information about the uClibc
mailing list