caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Fatal error: out of memory
@ 2005-11-05 11:56 Sarah DJEBALI
  2005-11-05 12:07 ` [Caml-list] " Sven Luther
  2005-11-10 14:51 ` Damien Doligez
  0 siblings, 2 replies; 6+ messages in thread
From: Sarah DJEBALI @ 2005-11-05 11:56 UTC (permalink / raw)
  To: caml-list

Hi,

I am using ocaml 3.08, and when running my executable on certain kind of 
data I get the message :
Fatal error: out of memory.

To diagnose the problem and as adviced in the user manual,  I have run 
ocamlrun with the option -v.
It displays lots of "growing heap..." messages with the heap size 
growing slowly.
In such situations the user manual says there is an attempt to construct 
a data structure with too many cells.

I know this may look a very naive question,
but is is possible to increase the heap size?

Thank you in advance
Sarah

-- 
************************************************************
Sarah Djebali
Laboratoire Dynamique et Organisation des Genomes (DyOGen)
CNRS UMR 8541
ENS, 46 rue d'Ulm, 75005 Paris 
email : djebali@ens.fr
Tel : 0033 1 44 32 23 74


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

* Re: [Caml-list] Fatal error: out of memory
  2005-11-05 11:56 Fatal error: out of memory Sarah DJEBALI
@ 2005-11-05 12:07 ` Sven Luther
  2005-11-05 17:09   ` Sven Luther
  2005-11-10 14:51 ` Damien Doligez
  1 sibling, 1 reply; 6+ messages in thread
From: Sven Luther @ 2005-11-05 12:07 UTC (permalink / raw)
  To: Sarah DJEBALI; +Cc: caml-list

On Sat, Nov 05, 2005 at 12:56:21PM +0100, Sarah DJEBALI wrote:
> Hi,
> 
> I am using ocaml 3.08, and when running my executable on certain kind of 
> data I get the message :
> Fatal error: out of memory.

Can you please try with 3.09 in experimental ?

> To diagnose the problem and as adviced in the user manual,  I have run 
> ocamlrun with the option -v.
> It displays lots of "growing heap..." messages with the heap size 
> growing slowly.
> In such situations the user manual says there is an attempt to construct 
> a data structure with too many cells.

Well, usually you get this behavior because your application is not written
optimally, especially with recursive functions.

> I know this may look a very naive question,
> but is is possible to increase the heap size?

Probably, but not sure it will solve your problem. There is an ocaml-beginner
mailing list somewhere which would be more appropriate though, as here we
usually deal with packaging issues mostly.

Friendly,

Sven Luther


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

* Re: [Caml-list] Fatal error: out of memory
  2005-11-05 12:07 ` [Caml-list] " Sven Luther
@ 2005-11-05 17:09   ` Sven Luther
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Luther @ 2005-11-05 17:09 UTC (permalink / raw)
  To: Sven Luther; +Cc: Sarah DJEBALI, caml-list

On Sat, Nov 05, 2005 at 01:07:42PM +0100, Sven Luther wrote:
> On Sat, Nov 05, 2005 at 12:56:21PM +0100, Sarah DJEBALI wrote:
> > Hi,
> > 
> > I am using ocaml 3.08, and when running my executable on certain kind of 
> > data I get the message :
> > Fatal error: out of memory.
> 
> Can you please try with 3.09 in experimental ?

Oh, well, i messed up the mailing list, sorry about that, please ignore my
debian related comments.

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

Still the beginner list above may be more appropriate, not sure if you where
there before.

Friendly,

Sven Luther


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

* Re: [Caml-list] Fatal error: out of memory
  2005-11-05 11:56 Fatal error: out of memory Sarah DJEBALI
  2005-11-05 12:07 ` [Caml-list] " Sven Luther
@ 2005-11-10 14:51 ` Damien Doligez
  1 sibling, 0 replies; 6+ messages in thread
From: Damien Doligez @ 2005-11-10 14:51 UTC (permalink / raw)
  To: caml users

On Nov 5, 2005, at 12:56, Sarah DJEBALI wrote:

> I know this may look a very naive question,
> but is is possible to increase the heap size?

The heap size increases automatically until your OS refuses to  
allocate more
memory to your program, then you get the "out of memory" message.

Your program is probably trying to build a data structure that is too  
big for
your computer.

-- Damien


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

* Re: [Caml-list] Fatal error: out of memory
  2012-06-05  0:32 Jianzhou Zhao
@ 2012-06-06 21:30 ` Brian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Campbell @ 2012-06-06 21:30 UTC (permalink / raw)
  To: caml-list

Hi,

On 05/06/12 01:32, Jianzhou Zhao wrote:
> Hi List,
>
> My program reports "Fatal error: out of memory" as a heisenbug on
> 64-bit machine. When I debugged my code or wanted to print any
> messages from the code, the error did not appear. Also, on 32-bit
> machine, the program has no "out of memory" problem. I found the
> message is from "asmrun/memory.c". Does anyone know any clue or hint
> to resolve the issue?

There's at least one optimisation in the compiler that can affect the 
memory profile of ocaml programs.  If memory serves, "let x = e1 in e2" 
can become "e2[e1]" where e1 is pure and x appears once, and I think 
these are sometimes generated for pattern matching where e1 is a 
projection.  This means that the value projected out of might be held 
for longer than the unoptimised version, increasing the memory usage.

I did have a (rather pathological) example of this where the debug 
version worked but the optimised one ran out of memory, but it was in a 
large application and I was unable to reproduce it later on.  There have 
been some related changes to the optimisation code in the meantime, so 
you might benefit from trying the beta version that was just announced. 
  If nothing else, it applies those optimisations when compiling debug 
versions too, so you might be able to see the failure during debugging.



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

* [Caml-list] Fatal error: out of memory
@ 2012-06-05  0:32 Jianzhou Zhao
  2012-06-06 21:30 ` Brian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Jianzhou Zhao @ 2012-06-05  0:32 UTC (permalink / raw)
  To: caml-list

Hi List,

My program reports "Fatal error: out of memory" as a heisenbug on
64-bit machine. When I debugged my code or wanted to print any
messages from the code, the error did not appear. Also, on 32-bit
machine, the program has no "out of memory" problem. I found the
message is from "asmrun/memory.c". Does anyone know any clue or hint
to resolve the issue?

Thanks!
--
Jianzhou

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

end of thread, other threads:[~2012-06-06 21:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-05 11:56 Fatal error: out of memory Sarah DJEBALI
2005-11-05 12:07 ` [Caml-list] " Sven Luther
2005-11-05 17:09   ` Sven Luther
2005-11-10 14:51 ` Damien Doligez
2012-06-05  0:32 Jianzhou Zhao
2012-06-06 21:30 ` Brian Campbell

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