Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Out_of_memory exception in output_value
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-29 (07:14)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Out_of_memory exception in output_value
On Sat, 2004-05-29 at 06:54, Eric Dahlman wrote:
> On May 28, 2004, at 2:44 PM, skaller wrote:

> >> Wouldn't it be more system-friendly to try successively factors *2, 
> >> *1.5,
> >> *1.1, and *1.05 before actually failing?
> I am not sure that it would have that much benefit for all of the 
> complexity it would introduce. 

I don't quite agree for the following reason: if something
fails when you're only using 50% of memory instead of 90%,
you're likely to be both puzzled and annoyed. In practice
this can make quite a difference at what sized problems
you can handle on your machine. It can also really trash out
a large server because malloc() is *required* to actually
allocate memory, not just address space.

Since allocations of this kind are rare the extra cost
doing a most sophisticated calculation isn't important.

As you point out though, the extra complexity is a real
problem: we could argue forever how to choose an optimial
calculation. Which is why I suggested the user be able
to do it. This delegates the complexity back to the
client and out of the library.

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: