Using mmap(2) with a hint address
Ganael LAPLANCHE
ganael.laplanche at martymac.org
Thu Dec 22 10:22:49 UTC 2011
Hi Artem, Tijl,
On Tue, 20 Dec 2011 09:27:43 -0800, Artem Belevich wrote
> Something like that. [...]
> These days malloc() by default uses mmap, so if you don't force it to
> use sbrk() you can probably lower MAXDSIZE and let kernel use most
> of address space for hinted mmaps.
> [...]
On Tue, 20 Dec 2011 18:45:08 +0100, Tijl Coosemans wrote
> I don't know about NetBSD but Linux maps from the stack
> downwards when there's no hint and FreeBSD maps from the
> program upwards. [...]
> malloc(3) used to be implemented on top of brk(2) so the size was
> increased on amd64 so you could malloc more memory. Nowadays malloc
> can use mmap(2) so a large datasize isn't really needed anymore.
I will use setrlimit(2) to lower datasize then.
Thanks a lot for your time and explanations,
Best regards,
--
Ganael LAPLANCHE <ganael.laplanche at martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac at FreeBSD.org>, http://www.FreeBSD.org
More information about the freebsd-stable
mailing list