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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 40D56BC69 for ; Wed, 14 Nov 2007 18:08:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAPK6OkdSX+nf/2dsb2JhbACBXI50 X-IronPort-AV: E=Sophos;i="4.21,417,1188770400"; d="scan'208";a="4462120" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 14 Nov 2007 18:08:56 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id lAEH8tgF007367 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 14 Nov 2007 18:08:56 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAPK6OkdSX+nf/2dsb2JhbACBXI50 X-IronPort-AV: E=Sophos;i="4.21,417,1188770400"; d="scan'208";a="4462114" Received: from 5.xs4all.nl (HELO capsaicin.mamane.lu) ([82.95.233.223]) by mail1-smtp-roc.national.inria.fr with ESMTP; 14 Nov 2007 18:08:50 +0100 Received: from master by capsaicin.mamane.lu with local (Exim 4.68) (envelope-from ) id 1IsLjL-0004cR-UV; Wed, 14 Nov 2007 18:08:47 +0100 Date: Wed, 14 Nov 2007 18:08:47 +0100 From: Lionel Elie Mamane To: Brian Hurt Cc: Stefan Monnier , caml-list@inria.fr Subject: Re: [Caml-list] Re: OCaml runtime using too much memory in 64-bit Linux Message-ID: <20071114170847.GC16398@capsaicin.mamane.lu> Mail-Followup-To: Lionel Elie Mamane , Brian Hurt , Stefan Monnier , caml-list@inria.fr References: <4731F5D1.2070405@janestcapital.com> <1194459622.15728.94.camel@localhost.localdomain> <47320E10.1050307@janestcapital.com> <200711140520.46016.romain.beauxis@gmail.com> <8ef825670711140403m464c01detff5537abb2211946@mail.gmail.com> <473AF04C.7030107@inria.fr> <473B2400.5050800@janestcapital.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <473B2400.5050800@janestcapital.com> X-Operating-System: GNU/Linux X-Request-PGP: http://www.mamane.lu/openpgp/rsa_v4_4096.asc User-Agent: Mutt/1.5.16 (2007-06-11) X-Miltered: at concorde with ID 473B2BA7.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 runtime:01 allocating:01 initialized:01 allocates:01 ocaml:01 runtime:01 wrote:01 wrote:01 caml-list:01 allocated:02 allocated:02 bytes:03 intimately:04 brian:05 On Wed, Nov 14, 2007 at 11:36:16AM -0500, Brian Hurt wrote: > Stefan Monnier wrote: >> How about allocating this array of bytes via mmap and then leave it >> uninitialized (relying on POSIX's guarantee that it's already >> initialized to zeros)? >> This way you can easily have a 4GB "dense" table which doesn't use much >> RAM since most of the 4GB will be mapped (via copy-on-write) to the same >> "zero page". > Even on a system like linux, which optimistically allocates memory > (i.e. the actually underlying memory isn't allocated until you > actually touch it), once you read the page, it has to actually exist > in memory. This may not be a problem (but only people that know the system intimately will *know*), it is plausible that the ocaml runtime system would not read any entry in the table corresponding to a page that is not allocated. Or maybe not. -- Lionel