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
[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 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