Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jan 2008 19:36:55 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Peter Schuller <peter.schuller@infidyne.com>
Cc:        Andrew Reilly <andrew-freebsd@areilly.bpc-users.org>, Peter Jeremy <peterjeremy@optushome.com.au>, Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-current@freebsd.org, Igor Mozolevsky <igor@hybrid-lab.co.uk>, Kostik Belousov <kostikbel@gmail.com>
Subject:   Re: sbrk(2) broken
Message-ID:  <86tzlonozc.fsf@ds4.des.no>
In-Reply-To: <200801080237.40379.peter.schuller@infidyne.com> (Peter Schuller's message of "Tue\, 8 Jan 2008 02\:37\:31 %2B0100")
References:  <15094.1199751424@critter.freebsd.dk> <200801080237.40379.peter.schuller@infidyne.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Schuller <peter.schuller@infidyne.com> writes:
> The problem with malloc() being that, unless I am missing something,
> malloc will never be able to give back memory to the kernel except
> insofar as the memory mapped is continuously unused between some
> location and the break (in the case of sbrk()) or over the entire
> range (mmap()).

Actually, malloc(3) can use madvise(2) to notify the kernel that
arbitrary pages in the arena are unused and can be discarded.  The
current implementation will do so if the H option is specified.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86tzlonozc.fsf>