malloc problems with MySQL?

Paul Allen nospam at ugcs.caltech.edu
Wed Apr 26 23:56:49 UTC 2006


>From Jason Evans <jasone at freebsd.org>, Wed, Apr 26, 2006 at 01:22:11PM -0700:
> This code behaves as intended.  Note that in order to get chunk-aligned 
> memory via mmap(), it is necessary to over-allocate, then trim.  By 
> keeping a cache of unmapped chunks, we can avoid the extra system calls 
> most of the time, and we are also able to reduce memory fragmentation in 
> many cases. (Over-allocation and trimming fails to utilize chunk-sized 
> holes in the memory map.)
Yes, I see... perhaps mmap should be enhanced to take an optional alignment
parameter. :o)

                                   Paul


More information about the freebsd-current mailing list