Why process memory starts so high up in virtual space with FreeBSD malloc?

Yuri yuri at rawbw.com
Mon Dec 1 14:57:29 PST 2008

Giorgos Keramidas wrote:
> The FreeBSD malloc(3) implementation can use either mmap() or sbrk() to
> obtain memory from the system.  It does not 'waste a high percentage of
> memory' but it simply maps only high addresses (with an unmapped 'hole'
> in lower addresses).

But the hole it leaves with MALLOC_OPTIONS='dM'  is way larger than the
one left by 'Dm' option. Usually malloc will keep allocating addresses 
than this initial value and will never come back and fill some parts of 
this gap.
Therefore "wasting" this space.


More information about the freebsd-questions mailing list