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 NAA28812; Tue, 3 Feb 2004 13:50:31 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA28609 for ; Tue, 3 Feb 2004 13:50:30 +0100 (MET) Received: from bourg.inria.fr (bourg.inria.fr [128.93.11.100]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i13CoUv16971 for ; Tue, 3 Feb 2004 13:50:30 +0100 (MET) Received: from starynke by bourg.inria.fr with local (Exim 4.30) id 1Ao00c-0008Vn-29; Tue, 03 Feb 2004 13:50:30 +0100 Date: Tue, 3 Feb 2004 13:50:30 +0100 To: Sarah DJEBALI , caml-list@inria.fr Subject: Re: [Caml-list] Sys.max_array_length Message-ID: <20040203125029.GA32663@bourg.inria.fr> References: <401F9076.8080505@ens.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <401F9076.8080505@ens.fr> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Basile Starynkevitch X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 basile:01 basile:01 2004:99 djebali:01 3.06:01 mlvalues:01 bigarrays:01 arrays:01 arrays:01 htmlman:01 cristal:01 cristal:01 bigarray:01 bigarray:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Feb 03, 2004 at 01:13:42PM +0100, Sarah DJEBALI wrote: > I have installed OCAML 3.06 and when executing a program that reads a > very long sequence (49 million characters) and puts it into an array, I > have got the message : > Fatal error: exception Invalid_argument("Array.make") Perhaps you should switch to ocaml-3.07, which is the current release, which have new interesting features IMHO (but won't solve this particular problem). > I understand this is due to a too small value for variable > Sys.max_array_length. Does anyone know how to increase it? > The only reasonable way to run your code without changes is to change your machine to a 64 bit architecture, like AMD64 (aka x86_64) ie Athlon64 processors or Alpha (or Sparc64). The maximal array length is wired in a lot of places, and changing it is not easy, because it is related to the layout of the header word inside the heap (see the comments inside for details). I tend to believe that dealing with very big arrays or strings may indicate that some parts of your algorithms should be rethought. But I may be really wrong.... Perhaps you should consider using caml bigarrays (with the ability to map a file - see documentation of function Bigarray.Array1.map_file at http://caml.inria.fr/ocaml/htmlman/libref/Bigarray.Array1.html etc....), or representing your huge data otherwise, eg as lists (or tuples or arrays) of smaller arrays. Consider changing some of your datastructures to deal with smaller arrays! Tell us about your experiments! Regards. -- Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr Project cristal.inria.fr - INRIA Rocquencourt bat 5 http://cristal.inria.fr/~starynke --- all opinions are only mine ------------------- 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