unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludovic.courtes@laas.fr (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: GC improvements
Date: Thu, 05 Jan 2006 15:47:30 +0100	[thread overview]
Message-ID: <87psn64tq5.fsf@laas.fr> (raw)
In-Reply-To: <87oe2snf01.fsf@laas.fr> (Ludovic Courtès's message of "Wed, 04 Jan 2006 17:18:22 +0100")

Hi,

ludovic.courtes@laas.fr (Ludovic Courtès) writes:

> This interleaving of initialization and sweeping makes it pretty hard to
> 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


  reply	other threads:[~2006-01-05 14:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-20 16:32 GC improvements Ludovic Courtès
2005-12-23 11:29 ` Han-Wen Nienhuys
2005-12-23 15:40   ` 1.8 [was: GC improvements] Andy Wingo
2005-12-24  0:59     ` 1.8 Kevin Ryde
2006-01-03 10:16   ` GC improvements Ludovic Courtès
2006-01-04  1:03     ` Han-Wen Nienhuys
2006-01-04 16:18       ` Ludovic Courtès
2006-01-05 14:47         ` Ludovic Courtès [this message]
2006-01-06 20:22           ` Han-Wen Nienhuys

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87psn64tq5.fsf@laas.fr \
    --to=ludovic.courtes@laas.fr \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).