From owner-freebsd-current@FreeBSD.ORG Fri Jan 4 13:12:50 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 AB6DA16A598; Fri, 4 Jan 2008 13:12:50 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 652A813C46E; Fri, 4 Jan 2008 13:12:49 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.2/8.14.2) with ESMTP id m04DClnW017948; Fri, 4 Jan 2008 16:12:48 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1199452368; bh=n/IDD2IV4h+atDBjmVAnXxAU2QmzOHbjxLnGTXj 2K9Y=; l=570; h=Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:User-Agent; b=LCkwsTyQlpWNs5VZKy2XoeTxzsACRB9bEijnQw7Z 5SXq2gKu4nfzywa3jn9l+Ha33aQiElgWE8scwhR4m/bkTJurYV4lsPkDD56exE/KSzF /fjETYgbMY/iNm/WEqHmNvokXU/VFSUqwqSPeOfopsFQrSrkmH1MVP3CfnSU5t7Q= Received: (from ache@localhost) by nagual.pp.ru (8.14.2/8.14.2/Submit) id m04DClOC017947; Fri, 4 Jan 2008 16:12:47 +0300 (MSK) (envelope-from ache) Date: Fri, 4 Jan 2008 16:12:47 +0300 From: Andrey Chernov To: Poul-Henning Kamp Message-ID: <20080104131247.GA17816@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Poul-Henning Kamp , freebsd-current@FreeBSD.ORG, Jason Evans References: <20080104122149.GA17103@nagual.pp.ru> <5705.1199451431@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5705.1199451431@critter.freebsd.dk> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-current@FreeBSD.ORG, Jason Evans 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: Fri, 04 Jan 2008 13:12:50 -0000 On Fri, Jan 04, 2008 at 12:57:11PM +0000, Poul-Henning Kamp wrote: > There is address space allocated to the process (via sbrk/mmap) > > A subset of this, is address space allocated by the program (via malloc) > > ...and then there is memory actually in use, which is an entirely different > thing, of which we currently only have some kind of clue in the VM > system. Then, we need sysctl to fetch that "memory actually in use" from the kernel and compare that with getrlimit() which allows malloc() to return 0 when needed. -- http://ache.pp.ru/