From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: GC improvements Date: Thu, 05 Jan 2006 15:47:30 +0100 Organization: LAAS-CNRS Message-ID: <87psn64tq5.fsf@laas.fr> References: <87slsnk9u0.fsf@laas.fr> <87mzid62hn.fsf@laas.fr> <43BB1EDF.7080404@xs4all.nl> <87oe2snf01.fsf@laas.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1136482678 19431 80.91.229.2 (5 Jan 2006 17:37:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2006 17:37:58 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 05 18:37:45 2006 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EuZ2v-0001GG-Mg for guile-devel@m.gmane.org; Thu, 05 Jan 2006 18:37:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EuZ4f-0001uc-7b for guile-devel@m.gmane.org; Thu, 05 Jan 2006 12:38:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EuWR2-0008Mx-98 for guile-devel@gnu.org; Thu, 05 Jan 2006 09:49:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EuWQx-0008LA-2r for guile-devel@gnu.org; Thu, 05 Jan 2006 09:49:47 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EuWQw-0008L6-Uq for guile-devel@gnu.org; Thu, 05 Jan 2006 09:49:43 -0500 Original-Received: from [140.93.0.15] (helo=laas.laas.fr) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EuWSX-0001gN-65 for guile-devel@gnu.org; Thu, 05 Jan 2006 09:51:21 -0500 Original-Received: by laas.laas.fr (8.13.1/8.13.4) with SMTP id k05ElqtD019661; Thu, 5 Jan 2006 15:47:53 +0100 (CET) Original-To: Han-Wen Nienhuys X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 16 =?iso-8859-1?Q?Niv=F4se?= an 214 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: Han-Wen Nienhuys , guile-devel@gnu.org In-Reply-To: <87oe2snf01.fsf@laas.fr> (Ludovic =?iso-8859-1?Q?Court=E8s's?= message of "Wed, 04 Jan 2006 17:18:22 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-Spam-Score: 0 () X-Scanned-By: MIMEDefang at CNRS-LAAS X-MIME-Autoconverted: from 8bit to quoted-printable by laas.laas.fr id k05ElqtD019661 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:5579 Archived-At: Hi, ludovic.courtes@laas.fr (Ludovic Court=E8s) writes: > This interleaving of initialization and sweeping makes it pretty hard t= o > track exactly where fresh cells come from. I guess one solution might > be to maintain a list of the uninitialized segments and pick cells > directly from there before actually sweeping. Thinking about it, this solution looks like the beginning of the generational approach to GC: we'd define uninitialized segments (i.e., those whose FIRST_TIME field is true) as one generation, and the others as another generation. I think we could even have 3 segment generations: 1. The kids, i.e., the uninitialized segments; 2. The youngsters, i.e., segments recently initialized and where sweeping gave good results in the past; 3. The elderly, i.e., those for which sweeping has been unproductive for some time already. Remarks: * This is a very coarse approach to generational GC as it's done on a per-segment basis. For this reason, it doesn't make sense to have more that 3 generations (due to fragmentation, each segment may include a variety of kids, youngsters, and elderly). Even 3 generations (instead of just 2) is a questionable approach. OTOH, even though there is fragmentation, I think it's reasonable to assume that some segments, those created and populated at startup time, will actually only contain elderly cells, whereas segments initialized during the life time of the program (especially for long-running or interactive applications) may be more fragmented and may be considered as "young". Hence the intermediary generation. Additionally, I'm assuming that elderly segments cannot move back to the "youngsters" generation, which seems to be generally assumed in generational GC. * This poor man's generational GC has the advantage of being quite easy to implement. Basically, instead of having a single segment table as we have now, we'd have to maintain a set of three segment tables, which would not be too complicated it seems. In particular, it's much easier to implement than the per-cell generational GC, as proposed by Greg Harvey in http://home.thezone.net/~gharvey/guile/ggc-notes.txt . It's also less intrusive: basically `scm_i_sweep_some_segments ()' is the only place where generations would be taken into account. Of course, the outcome would certainly be better with a per-cell approach, but I'd expect the per-segment approach to yield a non-null benefit for a pretty low cost. What do you think? Are there flaws in this reasoning? :-) Thanks, Ludovic. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel