From owner-freebsd-amd64@FreeBSD.ORG Mon Feb 16 06:00:40 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8D7216A4CE for ; Mon, 16 Feb 2004 06:00:40 -0800 (PST) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id 77DAC43D1D for ; Mon, 16 Feb 2004 06:00:40 -0800 (PST) (envelope-from ml@fruitbat.demon.co.uk) Received: from pr-webmail-2.demon.net ([194.159.244.50]) by anchor-post-31.mail.demon.net with smtp (Exim 3.35 #1) id 1AsjId-0007tY-0V; Mon, 16 Feb 2004 14:00:39 +0000 Received: from fruitbat.demon.co.uk ([195.74.121.82]) by web.mail.demon.net with http; Mon, 16 Feb 2004 14:00:39 +0000 From: ml@fruitbat.demon.co.uk To: "Brooks Davis" In-Reply-To: <20040126175234.GA28717@Odin.AC.HMC.Edu> Date: Mon, 16 Feb 2004 14:00:39 +0000 User-Agent: Demon-WebMail/2.0 MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: cc: freebsd-amd64@freebsd.org Subject: Re: malloc() over 4Gb X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2004 14:00:41 -0000 brooks@one-eyed-alien.net wrote: > On Sun, Jan 25, 2004 at 01:37:47PM +0000, ml@fruitbat.demon.co.uk wrote: > > Hi. Could someone clarify whether or not it's possible to malloc() > > and mmap() chunks of memory > 4Gb in size using FreeBSD/AMD64 and > > that FreeBSD/AMD64 isn't susceptible to the 4Gb process boundary that > > 32-bit OSs are restricted by? > > It works fine (just remember to set your malloc options to aj before > mallocing that much memory, it takes a loooong time if you done :-): > [9:52am] brooks@brimstone (~): uname -a > FreeBSD brimstone 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Tue Jan 6 13:18:20 P= > ST 2004 brooks@brimstone:/usr/obj/usr/p4/xname/sys/GENERIC amd64 > [9:52am] brooks@brimstone (~): ./a > a.out* aeroauth*=20 > [9:52am] brooks@brimstone (~): cat foo.c > #include > #include > #include > #define GB (1024*1024*1024) > int > main (int argc, char **argv) > { > void *foo; > printf("Trying to malloc %zd bytesn", (size_t)7*GB); foo =3D malloc((size_t)7*GB); > foo =3D malloc((size_t)7*GB); if (foo !=3D NULL) > if (foo !=3D NULL) > printf("Successn"); else > else > printf("failuren");} > } > [9:52am] brooks@brimstone (~): gcc -o foo foo.c > [9:52am] brooks@brimstone (~): ./foo=20 > Trying to malloc 7516192768 bytes > Success > [9:52am] brooks@brimstone (~):=20 Hi. Thanks for that information! I went out and bought the box and it does indeed seem to malloc() over 4Gb. However, if you change the allocation from 7*GB to 8*GB in your sample program, it still keels over inside malloc()! Do you know if there's any sort of 8Gb clamp in this OS?! Cheers! > -- Brooks A.