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] 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 (14:31)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Out_of_memory exception in output_value
Thanks to some people who helped me off-list.  I've solved this now.

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

In my case the final allocation was something like 260MB because the
size of the data required was approx 144MB (ie. just over 130MB, so it
needed to double the block).  realloc() was actually returning NULL
because the kernel couldn't allocate enough memory.

Allocating another 1GB of swap solves the problem nicely.


Richard Jones.
Merjis Ltd. - improving website return on investment - CRM improvement consultancy

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