From owner-freebsd-questions@FreeBSD.ORG Mon Dec 1 21:28:50 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94B711065672 for ; Mon, 1 Dec 2008 21:28:50 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell.rawbw.com (shell.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3238FC0A for ; Mon, 1 Dec 2008 21:28:50 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from eagle.syrec.org (c-67-188-126-36.hsd1.ca.comcast.net [67.188.126.36]) (authenticated bits=0) by shell.rawbw.com (8.13.6/8.13.6) with ESMTP id mB1LSn6h015389 for ; Mon, 1 Dec 2008 13:28:49 -0800 (PST) Message-ID: <49345710.9070403@rawbw.com> Date: Mon, 01 Dec 2008 13:28:48 -0800 From: Yuri User-Agent: Thunderbird 2.0.0.18 (X11/20081127) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Why process memory starts so high up in virtual space with FreeBSD malloc? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: yuri@rawbw.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 21:28:50 -0000 I am compiling the following program: #include main() { printf("0x%x\n", malloc(1)); } in 32-bit 7.1-PRERELEASE and get 0x28201100 which is ~673MB of 4GB address space or 16%. When I run the same program with the google malloc (from devel/google-perftools) I get much lower value 0x80aa0e8 which is ~135MB of 4GB address space or ~3%. Why FreeBSD memory allocator wastes such a high percentage of the memory space? Yuri