English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Array 4 MB size limit
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-05-15 (21:27)
From: akalin@a...
Subject: Re: [Caml-list] Array 4 MB size limit
Quoting Damien Doligez <damien.doligez@inria.fr>:

> On 2006-05-15, at 20:12, akalin@akalin.cx wrote:
>> I was greatly surprised when I found out there was such a low limit  
>> on arrays.  Is there a reason for this?  Will this limit ever be  
>> increased?
> It will be increased when you get a 64-bit machine ;-)

Of course it will. :) But what I meant was that the limit is nowhere 
near 32 bits (4 MB is only 22 bits), which leads me to believe that the 
limit is due to the implementation of arrays.  I was asking if there 
would be an improved implemetation of arrays which would increase this 
limit (up to 32 bits).

>> Also, the fact that using lists crashes for the same data set is  
>> surprising.  Is there a similar hard limit for lists, or would this  
>> be a bug?  Should I post a test case?
> I bet my mustache these crashes are stack overflows.

I was thinking otherwise, as it seemed to be crashing only when 
building the list.  The list is built by a parser rule which is reading 
from a line of floats.  The rule itself is recursive, which does imply 
a stack overflow, (or does it? ocamlyacc generates a LALR or some 
variant, right?) but changing that rule to use a Queue worked fine. 
(Until I tried to convert it into an array, which led me to discover 
the 4 MB limit)

Incidentally, what data structure does the Queue use internally? I 
didn't run into any of the problems I did with lists or arrays.

Frederick Akalin