From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=AWL,HTML_00_10,HTML_MESSAGE, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 3526ABC69 for ; Mon, 2 Jul 2007 19:46:40 +0200 (CEST) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.180]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l62HkdYT002378 for ; Mon, 2 Jul 2007 19:46:40 +0200 Received: by ik-out-1112.google.com with SMTP id b35so1400049ika for ; Mon, 02 Jul 2007 10:46:39 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=STekrlmBsBuF3dH6g9OHog2HT+yeWYcmDJSvG6IUkAsXXwhBg3MwO7v7eii1JC47Z7rWQ1MAuyVaxE2V3AR56NK2a9Y4YAbdHLbiWEXMjWSWTduDMbz+j0nNVAo7VLc3ssxqkODKTlLyu8/gEMUt+/EF/eQrn1/VYRBSfy86g/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Vms+X+sQhlMaqriN1nwS8M5sf6VAKhXj4J0IgshtijhmAVqS7CeYK1jFxtjX13awCmh17cb/TOPGuLRW+QShA3LWlBmMRm8oGSNfd3YDS8LzYkDAfqtwvepsN38asRQWweDhmGvsQ4tkT+NZUbbYD1z0Sx2MhSo3q0XnB8+KX8E= Received: by 10.78.136.9 with SMTP id j9mr3068352hud.1183398399085; Mon, 02 Jul 2007 10:46:39 -0700 (PDT) Received: by 10.78.189.19 with HTTP; Mon, 2 Jul 2007 10:46:39 -0700 (PDT) Message-ID: Date: Mon, 2 Jul 2007 19:46:39 +0200 From: Tom To: "Jon Harrop" Subject: Re: [Caml-list] Fork-friendly GC Cc: caml-list@inria.fr In-Reply-To: <200706261500.56979.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_60429_14194030.1183398399067" References: <200706261500.56979.jon@ffconsultancy.com> X-j-chkmail-Score: MSGID : 468939FF.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 468939FF.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; allocates:01 allocations:01 threads:01 afaik:01 allocates:01 allocations:01 threads:01 afaik:01 swept:98 swept:98 caml-list:01 modifies:02 modifies:02 problem:05 problem:05 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_60429_14194030.1183398399067 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 copied. 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 ------=_Part_60429_14194030.1183398399067 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 copied.

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
------=_Part_60429_14194030.1183398399067--