
On Tue, 24 Apr 2012, Trent W. Buck wrote:
*blink* - are you saying that bloatware (moco and friends) don't use malloc and free? WTF?! You'd think they can't read a manpage:
$ man brk | grep malloc Avoid using brk() and sbrk(): the malloc(3) memory allocation package is the portable and comfortable way of allocating memory.
Of course they use malloc. But for small allocations, malloc uses brk() to grow its heap. For larger allocations, it of course uses mmap(). Depends where the cutoff is, and the distribution of mallocs that are being made. I can easily imagine that most of mozilla's allocations (indeed, most stuff using higher level languages, because it's too damn easy to forget what you're doing when given too many language smarts) are a Kb or less (a 1x1 gif here, a line of text there, a widget up there), and might miss the cutoff. I think I read somewhere in one of the perennial "emacs23 eats ram like never before" threads that emacs uses 10k chunks for *everything*. Which means horrible wastage and fragmentation for anything smaller, and everything larger misses out on the benefit of using mmap(), because it misses that cutoff. -- Tim Connors