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
Inhibiting heap compaction
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Olivier Andrieu <oandrieu@n...>
Subject: Re: [Caml-list] Inhibiting heap compaction
 Florian Weimer [Friday 2 June 2006] :
 > Is it possible to prevent the heap from being compacted, 

Yes. cf the function Gc.set

  Gc.set { (Gc.get()) with Gc.max_overhead = max_int }

 > or pin individual objects?


 > Currently, I copy all strings used in such a scenario, but this
 > adds quite a bit of overhead.

Mind that your strings need to be in the major heap for the
no-heap-compaction approach to work. To ensure this, your strings must
be long enough or you should call Gc.minor () before calling the C