Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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 
malloc,
and other malloc blocks cannot interfere with its fragmentation.

If your program is allocating lots of temporary bigarrays and leaves 
them
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 
objects.
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 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