From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA26813; Fri, 28 May 2004 16:31:40 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA26632 for ; Fri, 28 May 2004 16:31:36 +0200 (MET DST) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4SEVZSH022766 for ; Fri, 28 May 2004 16:31:35 +0200 Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1BTiOU-0003GU-00 for ; Fri, 28 May 2004 15:31:34 +0100 Date: Fri, 28 May 2004 15:31:34 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] Out_of_memory exception in output_value Message-ID: <20040528143134.GA12481@redhat.com> References: <20040528091029.GA5436@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040528091029.GA5436@redhat.com> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 40B74D47.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 allocates:01 marshalled:01 doubles:01 allocating:01 crm:99 consultancy:99 ltd:98 kernel:01 ocaml:01 null:01 260:97 exception:02 allocate:03 data:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Thanks to some people who helped me off-list. I've solved this now. It turns out that during output_value, the OCaml code allocates a block of memory to contain the marshalled representation of the data. Each time it runs out of room, it doubles the size of that block using realloc(). In my case the final allocation was something like 260MB because the size of the data required was approx 144MB (ie. just over 130MB, so it needed to double the block). realloc() was actually returning NULL because the kernel couldn't allocate enough memory. Allocating another 1GB of swap solves the problem nicely. Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment http://www.winwinsales.co.uk/ - CRM improvement consultancy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners