From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 9D622BC6B for ; Thu, 8 Nov 2007 21:51:41 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAEcFM0dYvxGE/2dsb2JhbAA X-IronPort-AV: E=Sophos;i="4.21,391,1188770400"; d="scan'208";a="19087583" Received: from www.rastageeks.org (HELO mail.rastageeks.org) ([88.191.17.132]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Nov 2007 21:51:41 +0100 Received: from [192.168.1.135] (AMontsouris-156-1-94-80.w90-24.abo.wanadoo.fr [90.24.253.80]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.rastageeks.org (Postfix) with ESMTP id 874CA9C118 for ; Thu, 8 Nov 2007 21:51:35 +0100 (CET) From: Romain Beauxis To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] OCaml runtime using too much memory in 64-bit Linux Date: Thu, 8 Nov 2007 21:51:00 +0100 User-Agent: KMail/1.9.7 References: <4731F5D1.2070405@janestcapital.com> In-Reply-To: <4731F5D1.2070405@janestcapital.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200711082151.01017.romain.beauxis@gmail.com> X-Spam: no; 0.00; ocaml:01 runtime:01 malloc:01 ocamlrun:01 ocamlc:01 -nostdlib:01 -linkall:01 ocaml:01 toplevel:01 toplevellib:01 toplevel:01 topstart:01 cmo:01 compile:01 exception:01 Le Wednesday 07 November 2007 18:28:49 Adam Chlipala, vous avez =E9crit=A0: > A program that should be using just a few megabytes of RAM ends up using > 200+ MB to store a page table. =A0It seems that a C macro is defined by > default on 64-bit Linux to use mmap() instead of malloc(). =A0Ironically, > a comment says that this was done to avoid being given blocks of memory > that are very far apart from each other, forcing the creation of overly > large page tables. =A0It's ironic because that is exactly the problem that > is showing up now with mmap(). =A0It ends up called twice for the program > I'm looking at, and the two addresses it returns are far enough apart to > lead to creation of a 200 MB page table. Unfortunatly, you can't compile without that option=20 on amd64 archs, you'll get this error: =20 > boot/ocamlrun boot/ocamlc -nostdlib -I boot -linkall -o ocaml.tmp toplev= el/toplevellib.cma toplevel/topstart.cmo >Fatal error: exception Out_of_memory Romain