From owner-freebsd-current@FreeBSD.ORG Fri Jan 4 13:28:41 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 B04D216A47B; Fri, 4 Jan 2008 13:28:41 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 4388013C4EB; Fri, 4 Jan 2008 13:28:41 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 936DF17105; Fri, 4 Jan 2008 13:28:39 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m04DSd9S005975; Fri, 4 Jan 2008 13:28:39 GMT (envelope-from phk@critter.freebsd.dk) To: Andrey Chernov From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 04 Jan 2008 16:12:47 +0300." <20080104131247.GA17816@nagual.pp.ru> Date: Fri, 04 Jan 2008 13:28:39 +0000 Message-ID: <5974.1199453319@critter.freebsd.dk> Sender: phk@critter.freebsd.dk 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:28:41 -0000 In message <20080104131247.GA17816@nagual.pp.ru>, Andrey Chernov writes: >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. No we don't. Find a book that explains how Virtual Memory works. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.