From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 3C773BC75 for ; Sat, 12 Feb 2005 01:01:27 +0100 (CET) Received: from thesard.org (thesard.org [62.212.120.241]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1C01QRM026115 for ; Sat, 12 Feb 2005 01:01:27 +0100 Received: by thesard.org (Postfix, from userid 1000) id 723688F4D5; Sat, 12 Feb 2005 00:01:21 +0000 (UTC) Date: Sat, 12 Feb 2005 00:01:21 +0000 From: Guillaume To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Memory allocation nano-benchmark. Message-ID: <20050212000121.GA25785@void> References: <420B7A7E.90504@or.uni-bonn.de> <1108083859.16698.198.camel@pelican.wigram> <20050211112857.GC429@first.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050211112857.GC429@first.in-berlin.de> User-Agent: Mutt/1.5.6+20040907i X-Miltered: at nez-perce with ID 420D4756.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; guillaume:01 guillaume:01 thesard:01 caml-list:01 oliver:01 bandel:01 wrote:01 wrote:01 prevost:01 prevost:01 allocates:01 malloc:01 malloc:01 iirc:01 allocates:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Fri, Feb 11, 2005 at 12:28:57PM +0100, Oliver Bandel wrote : > On Fri, Feb 11, 2005 at 12:04:20PM +1100, skaller wrote: > > On Fri, 2005-02-11 at 03:50, Marwan Burelle wrote: > > > On Thu, 10 Feb 2005 09:59:53 -0500, John Prevost wrote: > > > > In a program that allocates one very large chunk of memory, > > > > > It also depends on malloc, on Linux it sometimes works > > > "optimisticaly", that is, it won't realy allocate memory unless you > > > use it > > You can call calloc() instead of malloc, so you automatically > use the memory. IIRC, calloc() does not always write the memory it allocates. If it allocates one little chunk of memory, it uses sbrk() + memset(). But on large ones, it uses mmap(), which do not write memory until a pagefault. > > Ciao, > Oliver Guillaume Leconte -- You're not a beautiful and unique snowflake.