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] Immediate Out_of_memory
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-13 (14:33)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] Immediate Out_of_memory
> After making a few minor changes, my program started raising the 
> Out_of_memory exception.  The strange thing is it fires a split 
> second after the program starts.  It happens so fast, 'top' doesn't 
> even have a chance to register it on its radar.
> I narrowed it down to a 'Hashtbl.find' application.

This is very likely due to a structural comparison (via =, like
Hashtbl.find does) between cyclic structures.  Structural comparison
maintains a recursion stack that is bounded, and raises Out_of_memory
when that stack overflows.  With 3.08, you can confirm this hypothesis
by running with OCAMLRUNPARAM set to 'v=63'; structural comparison
will print a message if it runs out of recursion stack.

- Xavier Leroy

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