From owner-freebsd-current@FreeBSD.ORG Tue Jan 8 18:37:04 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6BA016A418 for ; Tue, 8 Jan 2008 18:37:04 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE8713C461 for ; Tue, 8 Jan 2008 18:37:04 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id BFCDC20A0; Tue, 8 Jan 2008 19:36:55 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.2/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id A8F8C2049; Tue, 8 Jan 2008 19:36:55 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 8C32F844B6; Tue, 8 Jan 2008 19:36:55 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Peter Schuller References: <15094.1199751424@critter.freebsd.dk> <200801080237.40379.peter.schuller@infidyne.com> Date: Tue, 08 Jan 2008 19:36:55 +0100 In-Reply-To: <200801080237.40379.peter.schuller@infidyne.com> (Peter Schuller's message of "Tue\, 8 Jan 2008 02\:37\:31 +0100") Message-ID: <86tzlonozc.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Andrew Reilly , Peter Jeremy , Poul-Henning Kamp , freebsd-current@freebsd.org, Igor Mozolevsky , Kostik Belousov Subject: Re: sbrk(2) broken X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2008 18:37:04 -0000 Peter Schuller 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