Browse thread
Garbage collection and caml_adjust_gc_speed
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Damien Doligez <damien.doligez@i...> |
| Subject: | Re: [Caml-list] Garbage collection and caml_adjust_gc_speed |
On 2006-08-29, at 06:16, Christopher Kauffman wrote: > I am finishing up my first major research application written in > OCaml. The code is a scientific application which does a moderate > amount of floating point computations for which I have employed the > Bigarray library and the Lacaml package. [...] > What concerns me is the large overhead I seem to be getting from > the first function, 'caml_adjust_gc_speed', which I assume is > related to the garbage collector. Over 4 million calls to this > function seems a little much. I attempted to play with a garbage > collection parameter, the value of control.space_overhead in the Gc > module. According to the manual, this affects the major GC speed > and increasing the value is supposed to cut down on the > aggressiveness of the GC. Setting space_overhead to 99 did not > change number of calls to 'caml_adjust_gc_speed'. caml_adjust_gc_speed is called by caml_alloc_custom to tell it about resources (in this case, memory) outside the heap that depend on the allocated block. None of the GC parameter can reduce this number. I guess your program allocated over 4 million bigarrays. What I find surprising is that this simple function would dominate the run time of your program. I suspect some problem with gprof. Could you give us more details about the computations performed by your program? -- Damien