English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Stopping and continuing GC
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-17 (19:03)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Stopping and continuing GC
On Fri, Aug 17, 2007 at 09:44:14AM -0700, Shivkumar Chandrasekaran wrote:
> Are you saying that the "major sweeps" (whatever Gc.major does) are  
> also turned off....


> OTOH, the manual says:
> >If max_overhead >= 1000000, compaction is never triggered.
> If lablGTK has set this, then presumably calling Gc.major will have  
> no impact.

Precisely.  If you grab the actual code (byterun/compact.c) you will

  void caml_compact_heap_maybe (void)
    float fw, fp;
                                      Assert (caml_gc_phase == Phase_idle);
    if (caml_percent_max >= 1000000) return;

The GC runs in phases (and slices of work within some phases) and will
call this function when it has just finished a complete round of
collecting the major heap.  However this function won't do anything if
that max_overhead setting is as above.


Richard Jones
Red Hat