caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Out_of_memory
@ 2004-12-17  6:44 Christopher Alexander Stein
  2004-12-17 23:12 ` [Caml-list] Out_of_memory Damien Doligez
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Alexander Stein @ 2004-12-17  6:44 UTC (permalink / raw)
  To: caml-list


Hi, I am getting an exception Out_of_memory. The manual tells me
this is raised by the garbage collector when there is
insufficient memory to complete the computation. Is there any way
to find out what is causing this; what is gobbling up memory too
fast for the GC? Perhaps there is a way to get and analyze a core
file or a way to catch the exception and dump the heap and
garbage collector state. Any suggestions? I am using a C library,
but carefully followed the rules of;
http://caml.inria.fr/ocaml/htmlman/manual032.html
Though I suspect the C library is responsible.

Thanks

Lex


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

* Re: [Caml-list] Out_of_memory
  2004-12-17  6:44 Out_of_memory Christopher Alexander Stein
@ 2004-12-17 23:12 ` Damien Doligez
  2004-12-18  8:18   ` Christopher Alexander Stein
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Doligez @ 2004-12-17 23:12 UTC (permalink / raw)
  To: caml users

On 17 déc. 2004, at 07:44, Christopher Alexander Stein wrote:

> Hi, I am getting an exception Out_of_memory. The manual tells me
> this is raised by the garbage collector when there is
> insufficient memory to complete the computation. Is there any way
> to find out what is causing this; what is gobbling up memory too
> fast for the GC? Perhaps there is a way to get and analyze a core
> file or a way to catch the exception and dump the heap and
> garbage collector state. Any suggestions?

Have you tried using the debugger?

-- Damien


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

* Re: [Caml-list] Out_of_memory
  2004-12-17 23:12 ` [Caml-list] Out_of_memory Damien Doligez
@ 2004-12-18  8:18   ` Christopher Alexander Stein
  2004-12-18 11:10     ` Damien Doligez
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Alexander Stein @ 2004-12-18  8:18 UTC (permalink / raw)
  To: Damien Doligez; +Cc: caml users


Do you mean something more than gdb? I've used gdb and I get the
following stack trace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1075667072 (LWP 9819)]
0x0805a026 in caml_oldify_mopup ()
(gdb) bt
#0  0x0805a026 in caml_oldify_mopup ()
#1  0x0805a0e5 in caml_empty_minor_heap ()
#2  0x0805a190 in caml_minor_collection ()
#3  0x0805a21a in caml_check_urgent_gc ()
#4  0x0805ac3f in caml_alloc_string ()
#5  0x0805e138 in caml_create_string ()
#6  0x080688de in caml_interprete ()
#7  0x08059be9 in caml_main ()
#8  0x08059d60 in main ()
(gdb)

I'm not sure where to go from here. What do you recommend?

Thanks

Lex

On Sat, 18 Dec 2004, Damien Doligez wrote:

> On 17 déc. 2004, at 07:44, Christopher Alexander Stein wrote:
>
> > Hi, I am getting an exception Out_of_memory. The manual tells me
> > this is raised by the garbage collector when there is
> > insufficient memory to complete the computation. Is there any way
> > to find out what is causing this; what is gobbling up memory too
> > fast for the GC? Perhaps there is a way to get and analyze a core
> > file or a way to catch the exception and dump the heap and
> > garbage collector state. Any suggestions?
>
> Have you tried using the debugger?
>
> -- Damien
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


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

* Re: [Caml-list] Out_of_memory
  2004-12-18  8:18   ` Christopher Alexander Stein
@ 2004-12-18 11:10     ` Damien Doligez
  2004-12-18 18:35       ` Christopher Alexander Stein
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Doligez @ 2004-12-18 11:10 UTC (permalink / raw)
  To: caml users

On Dec 18, 2004, at 09:18, Christopher Alexander Stein wrote:

> Do you mean something more than gdb? I've used gdb and I get the
> following stack trace:

I mean ocamldebug.  It's well worth the investment of learning to use 
it.

> Program received signal SIGSEGV, Segmentation fault.

I'm not sure I understand how this segfault can translate to an
out-of-memory exception in the bytecode runtime.

-- Damien


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

* Re: [Caml-list] Out_of_memory
  2004-12-18 11:10     ` Damien Doligez
@ 2004-12-18 18:35       ` Christopher Alexander Stein
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Alexander Stein @ 2004-12-18 18:35 UTC (permalink / raw)
  To: Damien Doligez; +Cc: caml users


Interesting point. It was throwing Out_of_memory half the time
and segfaulting the other half (in caml_oldify_mopup), then I
carefully read through the C <-> OCaml chapter of the manual and
made sure my C library code is consistent with the rules outlined
there. Since those changes, it no longer throws Out_of_memory and
always segfaults in caml_oldify_mopup. I will take a look at
camldebug.

Thanks,

Lex

On Sat, 18 Dec 2004, Damien Doligez wrote:

> > Program received signal SIGSEGV, Segmentation fault.
>
> I'm not sure I understand how this segfault can translate to an
> out-of-memory exception in the bytecode runtime.
>
> -- Damien
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


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

end of thread, other threads:[~2004-12-18 18:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-17  6:44 Out_of_memory Christopher Alexander Stein
2004-12-17 23:12 ` [Caml-list] Out_of_memory Damien Doligez
2004-12-18  8:18   ` Christopher Alexander Stein
2004-12-18 11:10     ` Damien Doligez
2004-12-18 18:35       ` Christopher Alexander Stein

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