Version française
Home     About     Download     Resources     Contact us    
Browse thread
how to "disable" GC?
[ 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] how to "disable" GC?
On Mar 13, 2005, at 04:57, Eijiro Sumii wrote:

>   setenv OCAMLRUNPARAM 's=1000000000,v=0x1ff'
>
> and its variants, but none of them seem to stop GC from happening -
> and once it happens, it's MUCH slower of course!  By the way, the
> machine has 8GB main memory.
>
> So, my questions are:
>
> 1. How does the GC happen at all when the minor heap is so huge?  The
>    programs don't seem to use so much memory anyway...

Look for "caml_check_urgent_gc" in the runtime sources and you'll see
that minor collections can be triggered even if the minor heap is not
full if needed, in order to do a slice of major GC.

So if you allocate some things that go directly into the major heap
(for example reasonably large arrays or strings) you need a big major
heap as well as a big minor heap:

   setenv OCAMLRUNPARAM 's=500M,h=500M,v=0x1ff'

-- Damien