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
Fork-friendly GC
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-07-02 (17:46)
From: Tom <tom.primozic@g...>
Subject: Re: [Caml-list] Fork-friendly GC
Well, I believe that Fork-friendly GC is the same as Paging-friendly GC -
i.e., after a fork(), the memory is not copied into two different processes
until it is modified. So, even if a process allocates and modifies only a
small percentage of memory, the allocations might trigger the GC, which
means that all the memory is going to be swept and modified - and thus

The problem is, of course, that this is very process and/or programm
specific - it makes sense for the 24 Apache child processes to do GC, but it
is a waste of time for a forked BASH script processes that is going to
exec() after just a few lines.

The best solution I see here is to abandon the fork()-ing alltogether -
either things are run in the same process, only different threads, or
completely new processes are started (though one can only do that on Windows
platform, not on *NIX - AFAIK).

 - Tom