caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Immediate Out_of_memory
@ 2004-07-13 14:10 Tom Hawkins
  2004-07-13 14:32 ` Xavier Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Hawkins @ 2004-07-13 14:10 UTC (permalink / raw)
  To: caml-list

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.  Just prior to the 
statement I did a 'Gc.print_stat stdout':

minor_words: 1044856
promoted_words: 360738
major_words: 371008
minor_collections: 31
major_collections: 6
heap_words: 368640
heap_chunks: 6
top_heap_words: 368640
live_words: 352563
live_blocks: 83968
free_words: 15973
free_blocks: 513
largest_free: 9539
fragments: 104
compactions: 0
Fatal error: exception Out_of_memory

Do these numbers look OK?  I have 249MB of total swap memory, with 
currently 216 MB free.  Any ideas?

The results are the same for both 3.07+2 and 3.08.0.

I'll try to produce a simplified test case.  Unfortunately it's in a 
rather convoluted spot in the application.

Thanks for any help.

-Tom


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Immediate Out_of_memory
  2004-07-13 14:10 [Caml-list] Immediate Out_of_memory Tom Hawkins
@ 2004-07-13 14:32 ` Xavier Leroy
  2004-07-14  2:33   ` Tom Hawkins
  0 siblings, 1 reply; 3+ messages in thread
From: Xavier Leroy @ 2004-07-13 14:32 UTC (permalink / raw)
  To: Tom Hawkins; +Cc: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Immediate Out_of_memory
  2004-07-13 14:32 ` Xavier Leroy
@ 2004-07-14  2:33   ` Tom Hawkins
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Hawkins @ 2004-07-14  2:33 UTC (permalink / raw)
  To: caml-list

On Tuesday 13 July 2004 09:32 am, Xavier Leroy wrote:
> > 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.

Yes, that's it.

Many thanks for 3.08.

-Tom


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-14  2:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-13 14:10 [Caml-list] Immediate Out_of_memory Tom Hawkins
2004-07-13 14:32 ` Xavier Leroy
2004-07-14  2:33   ` Tom Hawkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).