On 30 Mar 2001, at 12:50, Henrik Nordstrom <hno@hem.passagen.se> wrote:
> >  heap_node. I modified dlmalloc abit so that it was eager to alloc
> >  chunks with mmap(). So unfilled chunks didn't contribute to heap
> >  fragmentation. Of course, dlmalloc wastes 1 page per mmapped alloc,
> >  so memory benefits were with larger chunks. While chasing the
> 
> well... dlmalloc uses a small 16 bytes (or was it 8) header on each
> mmap() area, so if you round down your allocations by this amount there
> should be no waste of pages.
 I hoped so too. But no. malloc aligns mmaped allocs to a page start.
 And it always _prepends_ its overhead. Because it doesn't know the
 alloc size at free() time, so it looks at front of it to find its
 housekeeping. With a mmap this unavoidably means that any mmaped
 alloc has a 1 page waste prepended... Requesting less gives nothing.
> >  It is hard to tell what pools get the least. Perhaps those that
> >  only make very few allocations during a squid run, and I picked
> >  minimal chunk size to be 16K. Some pools stayed empty most of the
> >  time.
> 
> Yes. And as the number of pools are growing a lot in 2.5 with lots of
> small pools we probably want to decrease the lower limit to only a few
> kb.
 thats very easy with Tune function.
> Do you mind putting this improved mempool up on SourceForge to ease
> further development and testing until merged into HEAD?
 Not at all. Just I don't know how to do it, and lacking time.
 patch against HEAD (as of 21.Nov.2000) is at:
   http://www.online.ee/~andre/squid/mempool/chunked_mempool.diff
 It doesn't touch existing mempool. Creates new mempool into lib/,
 adds new mempoolstats into src/, adds .h file into include/ and
 moves few supporting functions from src/ to lib/
 We can revert back to old mempool by patching Makefiles back.
 (lib/heap.c would brake I guess, as I made it use mempools)
------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Fri Mar 30 2001 - 04:19:52 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:41 MST