DragonFly kernel List (threaded) for 2009-04
DragonFly BSD
DragonFly kernel List (threaded) for 2009-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

New libc malloc committed


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Apr 2009 20:16:20 -0700 (PDT)

    libc now has a new malloc.  It appears to work well with buildworlds
    and pkgsrc, including firefox3.

    The new malloc is a bit more thread friendly then the old one.
    I didn't go overboard coding parallelism w/ pthreads but it is
    significantly better then the old malloc.  It also produces much
    less fragmentation for large persistent applications.  Perl, X, firefox,
    kde, etc.  Perl in particular, using the devel/libgweather build
    from pkgsrc as a test.  The old malloc had conniption fits on that
    build, the new one is smooth as butter.

    The raw malloc/free performance of the new allocator is about double
    that of the old one though related buildworld performance doesn't
    appear to change much, probably due to very slightly higher startup
    overhead as the slabs are mapped.

    --

    The new malloc is a port of our kernel SMP-friendly slab allocator,
    tuned down a bit to reduce page fault activity and VM footprint
    (things the kernel version doesn't have to worry about but the
    userland version does).

    The slab-based malloc supports about 80 different chunk sizes in 
    multiples starting at 8 bytes, making it extremely efficient for
    allocating large numbers of odd-sized structures all the way down
    to 8 bytes.  The lack of compaction for small numbers of
    disparately-sized allocations slightly increases the initial footprint
    but this same effect also tends to reduce fragmentation in long-running
    applications, which is more important these days.

					    -Matt



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]