Quoth w.c.humann@arcor.de (Wolfram Humann): > > But I also tried to follow up on Peter J. Holzer's remarks in > <http://groups.google.com/group/comp.lang.perl.misc/msg/8747b64794aec27b>. > He used strace for a closer look at what GNU malloc does and found that > it leaves free space after allocated memory so that it can often realloc > without moving memory. Does glibc have a malloc_size() function (or equivalent), and does perl use it? You can check with perl -V:'d_malloc.*_size'. If there is such a function but perl isn't finding it it may be worth fixing that. FreeBSD appears to have an equivalent function called malloc_usable_size, defined in <malloc_np.h>, which perl doesn't know about. When I get a chance I'll try hacking it in to see if it makes a difference (I don't think I've a hope of doing a proper Configure patch for it :(). > This free space (as far as I understand form > watching private memory usage reported by Linux::Smaps) is not > considered part of perl's memory ntil actually used. This is usual. Mapped memory that hasn't been touched yet isn't actually allocated anywhere by the kernel. (Linux is more aggressive about allowing over-allocation from userland than some other OSen.) BenThread Previous | Thread Next