From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q09L7UXv017870 for ; Mon, 9 Jan 2012 22:07:30 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAKlWC09QRFuw/2dsb2JhbABErFOBBYFyAQEFOj8QCzQSFCghiA+2cYUVhhljBJUHkjo X-IronPort-AV: E=Sophos;i="4.71,482,1320620400"; d="scan'208";a="138481785" Received: from furbychan.cocan.org ([80.68.91.176]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 09 Jan 2012 22:07:26 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.72) (envelope-from ) id 1RkMRB-00034z-40; Mon, 09 Jan 2012 21:07:25 +0000 Date: Mon, 9 Jan 2012 21:07:25 +0000 From: "Richard W.M. Jones" To: =?iso-8859-1?B?VPZy9ms=?= Edwin Cc: caml-list@inria.fr Message-ID: <20120109210725.GA11759@annexia.org> References: <96F225D0-B458-4E25-BE34-3976989984B2@ezabel.com> <20120101124454.GA12851@annexia.org> <012932EC-860F-4A40-98D1-E4B6EC123927@ezabel.com> <20120108184505.GA30498@annexia.org> <20120108190049.GB30498@annexia.org> <4F0A19CD.2030906@gmail.com> <20120109143143.GA31093@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120109143143.GA31093@annexia.org> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] Understanding usage by the runtime While we're on the subject of mmap tricks, here's another one that may be worth benchmarking. (The trick comes from examining the glibc sources). If you mmap a large contiguous area of memory that is more than you immediately need, mmap it PROT_NONE. The reason is that Linux won't swap out this memory. When you need to use the memory, you call mprotect PROT_READ|PROT_WRITE (on the part that you need) and use it as normal. Rich. -- Richard Jones Red Hat