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
Re: [Caml-list] Manually triggering garbage collection
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-29 (13:57)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] Manually triggering garbage collection
On 2008-07-29, at 15:39, Jean Krivine wrote:

> OK great I' ll try,
> For the moment I just set a Gc alarm that detects whether memory usage
> is above a certain limit and if so, sets the overhead to 0, which
> stops completely the memory "leak".

Setting the overhead to 0 seems a bit overkill.  You might want to
do a Gc.compact() at this point.  Or you might just need to change
the max_overhead parameter: the lower it is, the more often the
GC will compact the heap.

> Do you think that would improve to increase the size of the major  
> heap?

Yes, sometimes it helps with fragmentation.  Also, increasing the
heap_increment may help.

> Also, do you know how often the alarm is tested? is it each time a
> major collection is performed?

The GC alarms are triggered at the end of each major collection.

-- Damien