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] Slow GC problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-08 (10:28)
From: Damien Doligez <Damien.Doligez@i...>
Subject: Re: [Caml-list] Slow GC problem
On Monday, April 7, 2003, at 07:53 PM, Shivkumar Chandrasekaran wrote:

> Pursuing my earlier enquiry: I noticed that module Bigarray allocated 
> its arrays using "malloc" rather than on the ocaml heap. My problem 
> allocates a lot (say 100,000) bigarrays of rather small size (say 30 x 
> 30). Can this potentially increase the cost of gc? (I have this mental 
> picture of the ocaml heap fragmented by these immovable malloc'd 
> bigarrays.) Any help will be appreciated. Thanks,

It doesn't matter.  The ocaml heap is allocated in big chunks from 
and other malloc blocks cannot interfere with its fragmentation.

If your program is allocating lots of temporary bigarrays and leaves 
to be collected by the GC, then I would say it's using bigarrays in an
inefficient way.  Bigarrays are mostly designed to be long-lived 
If you can find a way to re-use your bigarrays instead of allocating new
ones, you should get better performance.

-- Damien

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