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-28 (16:47)
From: Jacques Carette <carette@m...>
Subject: RE: [Caml-list] Out_of_memory exception in output_value
> 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().

Wouldn't it be more system-friendly to try successively factors *2, *1.5,
*1.1, and *1.05 before actually failing?  This would not cost any
performance penalty in successful cases, and could decrease the number of
failing cases.  Seems win-win to me.  And as long as it is a multiplicative
factor, this does not lead to algorithmic degenerescence.


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