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=AWL 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 3F7FCBBCA for ; Thu, 8 May 2008 12:14:16 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8DABdvIkhQRFuwiGdsb2JhbACSAQEBAQ8gmWA X-IronPort-AV: E=Sophos;i="4.27,454,1204498800"; d="scan'208";a="25957143" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 May 2008 12:14:16 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m48AEFr3012910 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 8 May 2008 12:14:15 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8DABdvIkhQRFuwiGdsb2JhbACSAQEBAQ8gmWA X-IronPort-AV: E=Sophos;i="4.27,454,1204498800"; d="scan'208";a="25957141" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 May 2008 12:14:14 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1Ju38f-00052J-Hk for caml-list@inria.fr; Thu, 08 May 2008 11:14:13 +0100 Date: Thu, 8 May 2008 11:14:13 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] ocamlc.opt tries to allocate 34 GB of RAM ... and fails Message-ID: <20080508101413.GA18974@annexia.org> References: <20080507170149.GA21077@annexia.org> <04bfd9a7e0fb697f30fc7376d28b8fa5@localhost> <20080507183424.GA24624@annexia.org> <20080507184957.GA25416@annexia.org> <20080508091449.GA16556@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080508091449.GA16556@annexia.org> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Miltered: at discorde with ID 4822D277.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocamlc:01 compiler:01 gdb:01 malloc:01 malloc:01 aligned:01 runtime:01 bitmap:01 initialized:01 ffff:98 heap:01 heap:01 caml-list:01 caml:02 caml:02 OK I've found out where it's going wrong and I have a theory, ill-informed probably, about the problem. Firstly when I run the compiler with OCAMLRUNPARAM=v=0x1ff, just before the error I see: Growing heap to 4320k bytes Growing page table to 34359705221 entries No room for growing page table Fatal error: out of memory. and running it under gdb seems to indicate that the problem is a massive malloc() request, the second call to malloc in the function caml_add_to_heap. Now my uninformed theory: The preceeding mmap (from caml_aligned_mmap) returned a very high memory address: mmap(0x722020, 495648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffff7f83000 and the runtime is trying to construct a page table (bitmap, right?) to track both very low and very high addresses. That's failing, badly. Does this sound right? Unfortunately I have no idea how to solve this, certainly it seems there is no simple fix ... (I tried to set vm.overcommit_memory policy, but that doesn't work because the page table is initialized right after allocation). Rich. -- Richard Jones Red Hat