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 (14:04)
From: Jean Krivine <jean.krivine@g...>
Subject: Re: [Caml-list] Manually triggering garbage collection
Well if I don't set the overhead to 0, there is still a slight "
innactive memory" accumulation. However, when the memory goes back to
a reasonable level, I set the overhead back to 80 (which is the
default value) using another alarm. The result of this is that
inactive memory wobbles continuously during the execution (it
accumulates at overhead 80 and decreases at overhead 0).


On Tue, Jul 29, 2008 at 9:57 AM, Damien Doligez <> wrote:
> 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
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports: