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

Yuri yuri at rawbw.com
Mon Dec 1 13:28:50 PST 2008


I am compiling the following program:

#include <stdlib.h>
main() { printf("0x%x\n", malloc(1)); }

in 32-bit 7.1-PRERELEASE and get 0x28201100 which is ~673MB of 4GB 
address space or 16%.

When I run the same program with the google malloc (from 
devel/google-perftools)
I get much lower value 0x80aa0e8 which is ~135MB of 4GB address space or 
~3%.

Why FreeBSD memory allocator wastes such a high percentage of the memory 
space?

Yuri



More information about the freebsd-questions mailing list