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

2008-12-02 Thread Giorgos Keramidas
On Mon, 01 Dec 2008 14:57:23 -0800, Yuri [EMAIL PROTECTED] wrote: 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

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

2008-12-01 Thread Yuri
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

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

2008-12-01 Thread Giorgos Keramidas
On Mon, 01 Dec 2008 13:28:48 -0800, Yuri [EMAIL PROTECTED] wrote: I am compiling the following program: #include stdlib.h main() { printf(0x%x\n, malloc(1)); } You should probably use printf(%p, ptr) to print pointers :) in 32-bit 7.1-PRERELEASE and get 0x28201100 which is ~673MB of 4GB

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

2008-12-01 Thread Yuri
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

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

2008-12-01 Thread Dan Nelson
In the last episode (Dec 01), Yuri said: 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

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

2008-12-01 Thread Dan Nelson
In the last episode (Dec 01), Dan Nelson said: Here's what I get with a simple test program on a month-old 7.1-PRE Gah. silly mailing-list attachment stripper. #include stdlib.h #include stdio.h int main(void) { size_t malloced = 0; size_t chunksize = 1024*1024; void *first = NULL;